But yeah I once read an article that showed that compilers are often superior to even ASM programmers. And in the best cases you get if you are lucky a 10-20% increase in speed for a specific section.
This number gets repeated over and over even though it has been proven wrong. In the best case you do not get 10% speedup for a specific section. In the best case reported so far in this thread they got 30x speedup.
If you want to argue some kind of "average" case then that number is going to be somewhere between 1.0x (no speedup) or "pick some large number". It all depends. On the hardware, the compiler, the algorithm and the programmer.
If all of the worlds software were implemented as "perfect" assembly, the average speedup would probably be moderate, while the development time would sky-rocket. There is the 80/20 rule of thumb, saying that 80% of the execution time is spent in 20% of the code lines. If you decide to do something, do it to those lines (and again: assembly should be the last resort).
However in the total execution time of the program it will maybe be 0.01% an not at all worth the hassle. Really small, critical sections that use a huge amount of the total execution time are IMHO very rare.
If you are transcoding a video, the bulk of cpu cycles may be spent in a small section of code. If you are photoshopping, the same may be the case. In a game engine something similar might be true.
Now, office applications are a very different beast.
And last is to tge guy that mentioned Java being slow. In fact it isn't.
I love it when people throw out "in fact..". AFAIK, Java can be both fast and slow. Depending. Choose your tools wisely and all will be good.
That was true 20 years ago but now it's often just as fast (or even faster due to JIT) than C++. Main problem of Java AFAIK is there is almost no auto-vectorization (there is in some situations but depends on the JVM) or you have to already optimized your code so the JIT can better identify possible use of SIMD. But then your probably faster just using JNI...
http://developers.opengamma.com/articles/DGEMV.pdf
My understanding is that Intel are writing the very best compilers for Intel hardware. My understanding is (again) that they write for FORTRAN first. Then C. Then C++. Then the rest.
-k