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: [Patch] Fix istream::ignore + minor things


Damour, James A wrote:

Would your ignore code benefit from using __builtin_expect (see example
below)?

- if (__n != numeric_limits<streamsize>::max())
+ if (__builtin_expect(__n !=
numeric_limits<streamsize>::max(),1))


Thanks for the suggestion. The evidence about the benefits of __builtin_expect is actually rather thin, however. You may find various discussions about this topics on the lists.

The code is in flux, anyway, I have yet to provide the performance improvement that I promised, which now (after having fixed the conformance issue) is becoming quite clear. Expect something by the end of the week.

By the way, are you willing to benchmark on a machine of your choice the impact of __builtin_expect??

Thanks,
Paolo.


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