[Bf-committers] Optimization flags. Even speedier blender.

Kester Maddock bf-committers@blender.org
Sat, 22 Nov 2003 12:08:30 +1300


I use: -pipe -ffast-math -O3 -march=pentium3 -mmmx -msse -mfpmath=sse 
-fomit-frame-pointer
in my builds, and have done for some time.

Note that gcc (version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) 
miscompiles with -march=pentium4

Kester

Robert Wenzlaff wrote:

>I know we need to stick with 1 set that will work for all the platforms for 
>the official release.
>
>But as an interesting side note, I found that setting the following gcc flags 
>gave me about a 30% speed boost in rendering:
>
>-march=athlon-xp -msse -mfpmath=sse
>
>(Average of 3 renders of blacksmith.blend:
>standard flags:  Old render: 23.11s, Unified: 29.23s
>modified flags:  Old render: 17.68s,  Unified: 25.41s )
>
>It's like a free CPU upgrade.  Overclocking without the smell of burning 
>fiberglass...
>
>The -mmmx and -m3dnow flags did next to nothing.
>
>Going from -O2 to -O3 slowed the old renderer down just a bit, but sped the 
>unified renderer up.  (Probably broke a few other things, though I only 
>noticed the ones already known broken by -O2 with my gcc rev - I'd love to 
>see the list of reasons that lead to -O2).
>
>The speed difference between -O2 and -O1 was about 2-3% with with the standard 
>switches, but 4-5% with the -march, -msse, and -mfpmath flags set as above.
>
>No switch gave and significant change to my draw times, but I have a rather 
>speedy accelerated gfx card, so the CPU probably has very little influence 
>there.
>
>I guess to be fully sure I didn't break anything, I'd have to wait for the 
>regression suite.   I think I'll run highly optimized for a while and start 
>making a list.
>
>Maybe this is the topic for an article for the do-it-yourselfers out there.
>And autoconf can certainly detect some of this and set the right flags.
>  
>