by sounds · 14y ago · 0 comments
The claims about who has faster binaries are pretty difficult to judge - it seems they really are about equal. It may be highly superscalar CPUs with instruction reordering and register aliasing hide the difference.
[1] http://gcc.gnu.org/ml/gcc/2012-02/msg00134.html (probably unbiased) and http://clang.llvm.org/performance.html (probably biased)
Many of the Clang vs. GCC tests are clandestinely skewed towards llvm because they involve code that does not benefit from low level optimization.
Many of the people who work on GCC are scientists who want tight loop performance while many of the folks who work on clang want a BSD license.
As usual, the only reliable way to know which compiler generates better code for your program is to run benchmarks.
For what it's worth, I wasn't blown away by the compile times or error messages when I moved to Clang. I think GCC is getting a lot better, but I'd also learned to live with its failings regardless.
Performance-wise though I still generally get ~5-15% better speed on generated code with GCC (corei7).