One thing that fascinates me is how few studies actually compare the effects of compiler flag settings. -O, -O2 and -O3 are known to most Linux users, but there are many many other flags.
Apparently the results differ if the OS and/or the compiler themselves have been compiled using them!
There are a few older tests around on the net, but I haven't seen any new tests for at least three or four years. And Ii have lost my links to the older tests.
It would be nice to have an overview of what effect these gcc compiler flags have on the newer CPUs,
While there is an immense number permutations involved in such a test I recall one which randomized the settings and had some ... Ah, I found a similar (the same?) link: http://www.coyotegulch.com/products/acovea/
Thanks for considering it!
EDIT The ACOVEA was the one I thought of, and it is published under the GNU General Public License (GPL).
Last edited by sabriah; 07-04-2008 at 01:46 PM.
I used to run Gentoo years ago, which is (maybe) how I stumbled into it. I honestly don't remember. It is, however, more likely that wild surfing was the reason.The GNU Compiler Collection (GCC) compiles the C or C++ code that it is given into machine code that is understandable to the processor. In doing this there are many choices the compiler is faced with. There are many different ways of implementing various control structures in machine code. GCC has some standard setting that aren't too bad at all - but in most cases not quite optimal. The various flags offered by the compiler (there are about 30 of them) are enigmatic even to gcc developers. Nobody knows exactly which flags influence compile time and runtime or in which way.
With 30 different flags available testing all of them would be impossible. This is where acovea comes in handy. It uses a so called genetic algorithm to find the optimal flags for each individual system.
 Genetic Algorithms
For more details of course you should read Scott's page mentioned earlier. If you're really interested in the theory then I must recommend the excellent book "The Blind Watchmaker" by Richard Dawkins. After understanding his book you will understand why a genetic algorithm is suited to this kind of complex problem. Be warned however that just in the same way as evolutions has taken millions of years up to date, running acovea is highly processor intensive. Expect one iteration to take well over 24 hours with an Athlon-XP / Pentium 4.
[EDIT1: updated link to ACOVEA article]
Last edited by sabriah; 12-14-2009 at 06:16 AM.
Still, ANY optimization and/or benchmark is pretty much outdated with each new release of processor. Isn't that pretty much the essence of it, updating benchmarks and optimizations?