throw(), pure and const flags on functions

Jan Hubicka hubicka@ucw.cz
Wed Apr 15 22:40: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.
20% is code of all EH in tramp3d together.  A lot of EH is there because
new() can throw and we need to call all the destructors.  It is possible
to kill some of those since most of destructors winds up being no-ops,
but this is more about IPA DSE.

Based on stats from ipa-pure-const on original reasons why functions are
marked throwing, I would estimate that about half of EH is unnecesary.
This still seems important for me given that tramp3d is not having any
explicit EH.

Over last weekend for EH improvements I got profile-use tramp3d binary
down from 1900Kb to 1800kb, that is 5% savings so I think this is
resonable estimate.  I will need to combine changes I have so far
together and get better stats that I should have ready by Friday.

Honza



More information about the Libstdc++ mailing list