This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: exchange_and_add inlined in g++ 4.0.2


bert hubert wrote:

>>Well, certainly I should know the application in some detail in order to
>>be able to tell you something meaningful, which is not the case.
>>However, in general, I see numbers below 2%...
>>    
>>
>This is system wide, including kernel and idle cycles. Relative to my
>application is is more like 15%, which is real enough.
>  
>
A bit of additional info, in case you missed some of yesterday messages.
Given the cost of a function call on P4 (~10 cycles) vs that of an
atomic (~ 500-1000 cycles) it's unlikely that your profile would change
much if the atomics are inlined. Only a small fractions (say 5-10%) of
that 15%. Then, the only thing that would really pay off in your case is
not using atomic operations at all (you are single threaded).

In general, we are using atomic operations in three different places: 1-
locale (not going to change much in the near/mid future); 2- string (we
are working on new non-reference-counted designs and you will find also
a preview in 4.1, under ext/vstring.h); 3- New facilities in tr1, like
shared_ptr (we hope to move to something more efficient for 4.2).

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]