"may or may not", that is the question

Jeroen Demeyer jdemeyer@cage.ugent.be
Wed Sep 3 07:06:00 GMT 2008


John Fine wrote:
> It is a complicated situation and you may find that the option to unroll 
> loops makes the total program faster despite making most loops slower (a 
> few inner loops that took a lot of time might get faster while loops 
> that took less time get slower).  But even that much is far from 
> certain.  The total program might get slower.

You could also consider compiling your program with 
-fprofile-generate/-fprofile-use.  That way the compiler (hopefully) 
knows which loops to unroll and which not.  I usually get a speed gain 
of several percent that way.

Jeroen.



More information about the Gcc-help mailing list