optimizations

Woody Gilk woody.gilk at gmail.com
Mon Oct 18 05:03:39 UTC 2004


been looking around the net for some good gcc CFLAGS and i think i've
found the best set for AthlonXP users.

-O2 -mcpu=athlon-xp -march=athlon-xp -fomit-frame-pointer -mmx -msse
-dnow -mfpmath=sse

there's actually a noticable difference between using -O3 and -O2 with
-fomit-frame-pointer... strangely -O3 is slower. from what i gathered,
-O3 creates bigger binaries, so the speed increase is offset greatly
by the load time, so -O2 is actually faster because the binary is
smaller... or something to that effect.

a word of caution: -fomit-frame-point frees up a register in most
compiles, creating faster binaries, but it also (generally) breaks
debugging, so if you do any debugging at all, be aware that it could
break your debugging process. :)

just thought some people might be interesting. i recommend everyone
who uses -O3 try -O2 and see if it makes a difference. i don't have
hard stats, but my desktop definately feels more responsive after
recompiling my commonly uses GTK+ apps.

-woody (shadowhand)
----------------------------------------------------------
wgilk design and blog [ http://www.wgilk.com ]
follower of the fat penguin [ http://www.linux.org ]


More information about the Lunar mailing list