Re: /bzr/squid3/trunk/ r12194: Small optimization in CommOpener statistic accounting.

From: Kinkie <gkinkie_at_gmail.com>
Date: Tue, 3 Jul 2012 11:27:22 +0200

> Usually the other ++ works better in readability
>
> conn_->getPeer()->stats.conn_open++;
>
> or even
>
> conn_->getPeer()->stats.conn_open += 1;

With GCC this code:
15 int a=0;
16 a++;
17 ++a;
18 a+=1;

gets assembled as:
16 a++;
=> 0x0804873c <main(int, char**)+168>: 83 44 24 18 01 addl $0x1,0x18(%esp)
(gdb)
17 ++a;
=> 0x08048741 <main(int, char**)+173>: 83 44 24 18 01 addl $0x1,0x18(%esp)
(gdb)
18 a+=1;
=> 0x08048746 <main(int, char**)+178>: 83 44 24 18 01 addl $0x1,0x18(%esp)

-- 
    /kinkie
Received on Tue Jul 03 2012 - 09:27:35 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 04 2012 - 12:00:03 MDT