[linux-audio-dev] Re: Steve Harris' C++ v C benchmark

Steve Harris S.W.Harris at ecs.soton.ac.uk
Mon Feb 17 04:29:01 UTC 2003


On Mon, Feb 17, 2003 at 08:34:10 +0100, Roger Larsson wrote:
> Testing that i have done suggest that you should ALWAYS define the
> architecture of your target. (I have not checked if the example does this
> but it is usually forgot...)
> 
>  -march=pentium3
> or if you need it to run on older computers
>  -mcpu=pentium3
> (see man gcc search for "Intel 386")
> 
> And at least use optimization level -O1 (use -O3 to get automatic inlining)

Agreed. I generally use -O6, its not a good idea for general use, but for
small fast plugin code its often the fastest. My full set of flags is:

-O6 -fomit-frame-pointer -fstrength-reduce -funroll-loops
-fmove-all-movables -ffast-math ${MACHINE_SPECIFIC}

I'd be interested to see how this compares with other peoples. I've been
meaning to write a test script that tries all the combinations to find
which produces the fastest code.

The -march, -mcpu flags are the mostimportant (they go in
MACHINE_SPECIFIC), but -ffast-math can help a lot too.

- Steve



More information about the Linux-audio-dev mailing list