4 ms·
GCC with max optimization still generally produces faster binaries than clang, but clang is constantly improving and in a few years they will probably be very s
by voldacar 5y ago
GCC with max optimization still generally produces faster binaries than clang, but clang is constantly improving and in a few years they will probably be very similar.
- tambourine_man 5y agoIs that still true though? It was definitely the case some 5-10 years ago, but last time I checked they were pretty comparable, losing some, winning others.
- voldacar 5y agoclang wins on some benchmarks, but gcc wins on over 50% of benchmarks, at least this always seems to be the case whenever I look it up. If I were writing a program that needed to be really fast I would just compile with both on max optimizations and pick whichever was best. Most software isn't the linux kernel and will work fine with both compilers
- pyler 5y agosource? llvm 13?
- qalmakka 5y agoThese benchmarks also don't reflect how good are the backends for different CPU architectures in GCC and LLVM. For instance, GCC is by far the dominant compiler on GNU/Linux on x86, while LLVM has a almost total monopoly of AArch64 (think about Android NDK + iOS + macOS). I think it would be quite natural for the GCC AArch64 backend to get less focus compared to its x86 counterpart. It's a complicated landscape that is always full of gotchas, and that's why I don't like these kinds of benchmarks a lot.
- mhh__ 5y agoIt's still true. Basically it's even as makes no difference except for ones where GCC is still way ahead. Real world code has to be measured for each to decide. The key takeaway is that GCC is still an extremely good compiler.
- hulitu 5y agoThat's why they said since 5 years. My experience was that clang seems longer compiling but due to the fact i did not compiled the same program with clang and gcc i would not take it as a rule.
- voldacar 5y agoI was referring to performance of the compiled program, not the time it takes to compile it.