PDA

View Full Version : Maximum optmization to maximize speed in release



thru
19th May 2011, 12:21
Hi
I was testing flags for optmizing at the maximum for speed on gcc (in the Release config). I wanted to try -O3 rather than the default -O2 so I've added QMAKE_CXXFLAGS += O3
But in the compiler output I see that after my CXXFLAGS with the -O3 it appears automatically -O2. As in the gcc docs I've seen that the last -O* is the effective one, I wonder where is that -O2 configured and if my -O3 is effectively taken into account.

By the is that the best option to maximize for speed or ar there other recommended settings?. I've tried also -Ofast but get an error from the compiler, it was the first attempt though so I may have to insvestigate more.

Thanks!

lukass
19th May 2011, 12:43
You can use also(if you use QStrings):

DEFINES += QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_PLUS
in your .pro file. But this may break your code.

See also:
http://www.slideshare.net/qtbynokia/optimizing-performance-in-qtbased-applications