The Computer Language
22.05 Benchmarks Game

Fastest cpu secs C gcc versus C clang

Always look at the source code.

If the fastest programs are hand-written vector instructions, does the host language matter? You might be more interested in the less optimised programs — more cpu seconds, less gz source code.

fannkuch-redux
source mem gz cpu
C gcc #6 1,044 1576 8.26
C clang #6 1,152 1576 8.28
C clang #4 1,048 1183 13.24
C gcc #4 964 1183 13.89
C gcc #5 1,072 910 29.38
C clang #5 1,052 910 31.60
C clang #3 1,048 567 32.39
C clang #2 1,164 1557 34.16
C clang 1,052 508 37.89
C gcc #3 1,016 567 42.18
C gcc 988 508 43.27
C gcc #2 1,140 1557 45.01
n-body
source mem gz cpu
C gcc #9 992 1633 2.12
C clang #9 1,032 1633 2.21
C clang #8 8 1391 3.49
C gcc #8 8 1391 4.10
C gcc #4 1,304 1490 4.44
C clang #4 1,272 1490 5.59
C clang #5 992 1429 5.62
C clang #6 1,280 1180 5.74
C clang 1,252 1173 5.96
C clang #2 1,292 1263 6.03
C gcc #5 1,020 1429 6.10
C clang #3 1,312 1208 6.34
C gcc #7 1,300 1244 6.79
C clang #7 1,292 1244 6.93
C gcc #2 1,264 1263 7.19
C gcc #6 1,304 1180 7.21
C gcc #3 1,304 1208 7.23
C gcc 1,264 1173 7.55
spectral-norm
source mem gz cpu
C clang #6 3,044 1197 1.56
C gcc #6 1,068 1197 1.57
C gcc #5 1,344 569 2.85
C gcc #4 1,352 1139 2.85
C clang #5 3,332 569 2.86
C clang #4 3,184 1139 2.87
C clang 1,456 383 5.31
C gcc 1,248 383 5.38
C gcc #3 1,348 463 5.68
C clang #3 3,368 463 5.72
mandelbrot
source mem gz cpu
C gcc #6 31,244 1135 5.12
C clang #9 30,664 694 5.15
C gcc #8 33,068 782 6.29
C clang #8 32,212 782 6.54
C gcc #4 32,704 799 13.81
C clang #4 33,936 799 13.85
C gcc #7 33,108 994 13.87
C clang 30,180 822 13.89
C clang #7 34,224 994 13.91
C gcc 29,692 822 13.91
C gcc #3 29,840 763 13.99
C clang #3 30,100 763 14.18
C gcc #9 32,904 694 16.03
C clang #2 996 400 25.27
C gcc #2 1,040 400 25.30
C clang #6   Make Error  
pidigits
source mem gz cpu
C clang #2 2,888 416 0.73
C gcc 2,648 452 0.73
C gcc #2 2,920 416 0.74
C clang 2,644 452 0.74
regex-redux
source mem gz cpu
C gcc #5 152,220 1397 2.02
C clang #5 154,192 1397 2.80
C clang #2 103,212 1115 3.20
C gcc #2 103,084 1115 3.23
C gcc #4 152,056 1230 3.24
C gcc #3 103,540 1266 3.31
C clang #4 154,168 1230 3.67
C clang #3 105,592 1266 4.35
fasta
source mem gz cpu
C clang #9 1,256 1463 0.78
C gcc #9 1,256 1463 0.78
C clang #5 1,028 1281 1.21
C gcc #5 1,052 1281 1.30
C clang #8 1,248 1293 2.48
C gcc #8 1,044 1293 2.74
C gcc #6 2,140 1930 2.76
C clang #6 3,764 1930 2.95
C clang #4 1,032 1240 2.98
C gcc #4 1,020 1240 3.06
C gcc #2 2,860 2268 3.25
C clang #2 3,952 2268 3.26
C gcc #7 2,864 2011 3.28
C clang #7 3,988 2011 3.28
C clang 992 1206 3.67
C gcc 1,016 1206 3.67
C gcc #3 972 819 4.49
C clang #3 988 819 4.50
k-nucleotide
source mem gz cpu
C gcc 130,156 1506 12.31
C clang 129,064 1506 12.44
reverse-complement
source mem gz cpu
C gcc #7 499,132 1965 0.57
C clang #7 499,220 1965 0.57
C clang #8 499,188 1627 0.65
C gcc #8 499,184 1627 0.77
C gcc #6 688,416 820 1.27
C gcc #5 994,088 647 1.42
C gcc #2 994,152 750 1.45
C clang #2 994,164 750 1.56
C clang #5 994,092 647 1.96
C gcc #4 500,416 709 3.49
C clang #4 500,352 709 3.74
C clang #6 723,976 820 3.75
binary-trees
source mem gz cpu
C gcc #2 168,384 809 4.32
C gcc #3 134,068 836 4.71
C clang #3 133,844 836 5.56
C clang #2 169,564 809 5.81
C clang 263,672 654 18.36
C gcc 263,664 654 22.16
C gcc #5 351,304 908 32.02
C clang #5 351,284 908 32.79
C gcc

11.2.0-19ubuntu1

C clang

14.0.0-1ubuntu1