GCC vs. LLVM Clang Compilers For The Apple M2 On Linux
Obviously there are other considerations to make too in the compiler selection beyond just the speed of the resulting binary... Support for sanitizers, various debugging options, speed of builds, compiler hardening options / security, the quality of warning/error messages, the size of the resulting binaries, and much more should also be considered when choosing between GCC and Clang for building production/release binaries.
Both the GCC and Clang compilers did have strong leads in different areas depending upon which codebases/applications you are using the most or interested in maximizing the performance potential.
If taking the geometric mean of all the benchmarks, GCC 12 was nearly 7% faster than Clang 14 for these tests on the Apple M2 MacBook Air running Asahi Linux.
Those interested in all the numbers in full can see this result page for all the details.
If you enjoyed this article consider joining Phoronix Premium to view this site ad-free, multi-page articles on a single page, and other benefits. PayPal or Stripe tips are also graciously accepted. Thanks for your support.