throw(), pure and const flags on functions

Mark Mitchell mark@codesourcery.com
Wed Apr 15 22:27:00 GMT 2009


Jan Hubicka wrote:

>> Jan, I'd also love to see performance figures about how much this helps.
>>  As always with optimizations, I'd like more quantitative data.  Here,
>> it's not so important since there's no downside I can see, but it would
>> still be fun to know that this actually does something valuable. :-)
> 
> Those few nothrow on RB trees saves about half of all EH control flow of
> tramp3d, that is about 12000 EH edges. No runtime difference since all
> the EH happens outside hot spots, but the EH code accounts over 20% of
> tramp3d binary, so savings are noticeable too.

20% code size savings are very noticeable; that's a great justification.

> I wonder if some kind of stuff like
> mozilla or something similar can serve as good benchmark of code that
> actually does some nontrivial EH.

I don't have a great example either.  You're right that anyone writing
performance-critical C++ is going to work hard to avoid EH in inner
loops, so I would suspect that a lot of the win is indeed going to be
code size.  I don't know enough about the Mozilla code-base to know if
it's a good example of EH, or not.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Libstdc++ mailing list