Mozilla Spots Massive Performance Regression In GCC
Phoronix: Mozilla Spots Massive Performance Regression In GCC
Mozilla developers on the GCC mailing list have been expressing what they describe as a "massive performance regression" and "what might be the biggest compiler-upgrade-related performance difference we've seen at Mozilla." The Mozilla developers have upgraded from GCC 4.3 to GCC 4.5, which was released in April, and now they are experiencing massive slowdowns...
Phoronix plays an important role in software development for Linux. If it wasn't for Phoronix, Linux and many other open source software would slow down by every release as the majority of open source developers don't realize the importance of automated quality checking & benchmarking. But luckily there are also commercial companies doing these kind of tests, because Phoronix can't do everything.
Am I correct in assuming these performance hits are for the finished (compiled) program, as opposed to the performance of GCC itself? Based on the wording of the article, I would assume it is the former, but I suppose it would not be hard to benchmark how long it takes to compile the software and therefore report on that timing.
Expecting -Os te be faster from release to release is naive. It is not intended to be faster, it is intended to be slower, but smaller. An app like Firefox should not use preset, but only profile based code path and cherry picked C/XX/FLAGS and LDFLAGS for both the main application and statically included dependencies.
You would be amazed at the insane amounts of red tape required to change even the slightest detail in Mozilla products. Changing a compiler switch is for them as big a deal as rewriting code from scratch in other projects.
I've found gcc (and especially g++) 4.5 to be much better than 4.3, in both speed-of-generated-code and generated-code size.
I suspect Mozilla has probably tweaked their code and their compilation options based on the specific behavior of gcc 4.3; if so, they're going to have to redo it for 4.5. Most of the changes in 4.5 are for the better, but nonetheless, they may interfere with fragile tweaks aimed at an earlier compiler version.
Optimizaing for size rather than speed could be the culprit, but unless the code is dramatically smaller with 4.5 versus 4.3 I doubt it's an intentional regression from the gcc guys. Would be interesting to see the results if they optimized for speed instead.
Anyway, going from 4.3 to 4.5 is quite a big step, and PGO is available in 4.4 so they don't need to go to 4.5 for that.
Personally I've only benchmarked with -O3 and -O2 and in pretty much all cases 4.5 has been faster than previous versions for me.