Benchmarking LLVM & Clang Against GCC 4.5

Written by Michael Larabel in Software on 21 April 2010 at 01:00 AM EDT. Page 6 of 6. 17 Comments.

LLVM-GCC had the best results with Himeno, a Poisson pressure solver, but when Clang was involved, it had the worst numbers. The LLVM-GCC binary produced 60% more MFLOPS than the LLVM Clang version.

Clang had not worked with John The Ripper, but with LLVM-GCC its performance was dismal compared to GCC 4.5.0. The 23-year-old compiler was 60% faster than LLVM-GCC.

Binaries from LLVM-GCC and Clang both struggled to compete with GCC 4.5.0 in the timed HMMer benchmark of a Pfam database search. LLVM-GCC and Clang were about 23% slower.

While using LLVM is faster at building code than GCC (except for the ImageMagick application), in most instances the GCC 4.5 built binaries had performed better than LLVM-GCC or Clang. Clang did deliver a surprising lead over GCC 4.5 and LLVM-GCC with the Apache benchmark where the Clang-built Apache managed to handle 9% more requests per second. There was also significant benefits for LLVM-GCC and Clang with the BYTE Unix Benchmark running the Dhrystone 2 test, but in the rest of the tests the performance was either close to that of GCC or well behind. In some tests, the performance of the Clang generated binaries was simply awful.

Though LLVM / Clang isn't the performance champion at this point, both components continue to be under very active development and there will hopefully be more news to report in the coming months. The LLVM/Clang performance may also certainly improve once more open-source projects begin offering support for detecting and better hooking into Clang. LLVM also does have other advantages over the GNU Compiler Collection that cannot be benchmarked. At the same time though, GCC has the benefits of supporting more hardware targets and hardware optimizations than does LLVM at this point and LLVM also has no plans for supporting Java, Fortran, or some of the other GCC-supported language front-ends. GCC's C++ support is also much more complete than LLVM's Clang at this point.

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.


Related Articles
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.