The Computer Language
Benchmarks Game

C gcc versus C clang fastest programs

Always look at the source code.

These are only the fastest programs. Do some of them use manually vectorized SIMD? Look at the other programs. They may seem more-like a fair comparison to you.

binary-trees
source secs mem gz busy cpu load
C gcc 1.54 168,832 809 4.35 60% 67% 57% 100%
C clang 7.69 351,340 908 27.75 92% 91% 88% 91%
regex-redux
source secs mem gz busy cpu load
C gcc 0.80 152,172 1397 2.01 52% 99% 48% 53%
C clang 3.12 103,044 1115 3.14 100% 0% 1% 0%
mandelbrot
source secs mem gz busy cpu load
C gcc 1.27 31,792 1135 5.08 100% 100% 99% 100%
C clang 3.49 29,608 822 13.94 100% 100% 100% 100%
reverse-complement
source secs mem gz busy cpu load
C gcc 0.86 712,208 820 1.27 99% 28% 1% 19%
C clang 1.07 994,176 750 1.55 15% 88% 12% 30%
fannkuch-redux
source secs mem gz busy cpu load
C gcc 7.58 872 910 29.61 100% 98% 99% 93%
C clang 8.85 936 1557 34.65 94% 100% 98% 99%
n-body
source secs mem gz busy cpu load
C gcc 2.18 768 1633 2.19 0% 100% 0% 0%
C clang 2.21 768 1633 2.23 0% 0% 0% 100%
fasta
source secs mem gz busy cpu load
C gcc 0.78 1,156 1463 0.78 0% 0% 0% 100%
C clang 0.78 1,160 1463 0.79 0% 1% 100% 0%
pidigits
source secs mem gz busy cpu load
C gcc 0.81 2,804 416 0.84 1% 2% 99% 1%
C clang 0.81 2,792 416 0.85 6% 0% 0% 99%
spectral-norm
source secs mem gz busy cpu load
C gcc 0.40 872 1197 1.58 100% 100% 100% 98%
C clang   Make Error
k-nucleotide
source secs mem gz busy cpu load
C gcc 3.72 130,260 1506 12.07 100% 89% 78% 57%
C clang   Make Error
C gcc

gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0

C clang

Ubuntu clang version 12.0.0-1ubuntu