Hi,

On Sunday 06 November 2005 16:20, Mattias Engdegård wrote:
> Robert Dewar <[EMAIL PROTECTED]> writes:
> >> Including loop unrolling to -O2 is IMNSHO a bad idea, as loop unrolling
> >> increases code size, sometimes a lot.  And the distinction between -O2
> >> and -O3 is exactly in the space-for-speed tradeoffs.
> >
> >That's certainly a valid way of defining the difference (and certainly
> >used to be the case in the old days when the principle extra optimization
> >was inlining)
>
> But even -O2 makes several space-for-speed optimisations (multiply by
> shifting and adding, align jump targets, etc), so this cannot define
> the difference between -O2 and -O3. It is more quantitative in nature:
> -O2 only generates bigger code where the payoff in speed is almost
> certain, which is not always the case for unrolling/inlining.
>
> Still, more and more projects seem to be switching to -Os for everything
> which could be interpreted as both a consequence of the inevitable
> bloating of large programs but also as a dissatisfaction with what -O2/3
> does to the code. Or maybe they are wisening up and actually using the
> option that has been there all along.

We used -Os in the past, however I saw major speed regression for C++ with -Os 
and 4.0.0. I would need to meassure again with 4.0.x or 4.1 to see if that 
changed after the .0 release.

Yours,

-- 
René Rebe - Rubensstr. 64 - 12157 Berlin (Europe / Germany)
            http://www.exactcode.de | http://www.t2-project.org
            +49 (0)30  255 897 45

Attachment: pgp5hgTPcRXjm.pgp
Description: PGP signature

Reply via email to