October 21, 2005 Archives

Fri Oct 21 21:27:05 CEST 2005

GCC optimization

The new Issue of the Red Hat Magazine has an interesting article about "performance tuning with gcc", by one of the gcc devs. Take a look at it, especially if you feel the constant need to use obscure CFLAGS ;)

Some interesting quotes:

In most cases, obtaining the very last nanosecond of performance is not terribly important. Optimization follows a distinct 
curve of diminishing returns. Most applications will thrive with the default transformations done at -O2, and since some of the more 
esoteric flags are seldom used, your code may behave erratically because of latent bugs in your application (for example, the code 
may be violating language aliasing rules).


An even bigger problem is the interactions between optimizing transformations. It is not uncommon for different optimizations to 
interfere or even cancel each other out, so by combining many different flags, you may be causing more harm than good.

Posted by Andreas Proschofsky | Permanent Link