The Computer Language
22.05 Benchmarks Game

Fastest cpu secs C gcc versus Classic C

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
Classic C #6 1,364 1576 8.41
C gcc #4 964 1183 13.89
Classic C #4 1,296 1183 15.14
C gcc #5 1,072 910 29.38
Classic C #3 1,280 567 33.75
Classic C #5 3,440 910 35.76
Classic C #2 1,420 1557 39.23
Classic C 1,324 508 40.54
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
Classic C #9 1,320 1633 2.82
C gcc #8 8 1391 4.10
C gcc #4 1,304 1490 4.44
Classic C #7 1,280 1244 5.69
Classic C 1,268 1173 5.74
C gcc #5 1,020 1429 6.10
Classic C #3 1,252 1208 6.31
Classic C #2 1,320 1263 6.38
Classic C #6 1,324 1180 6.45
C gcc #7 1,300 1244 6.79
Classic C #4 1,280 1490 7.06
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
Classic C #5   Make Error  
Classic C #8   Make Error  
spectral-norm
source mem gz cpu
C gcc #6 1,068 1197 1.57
Classic C #6 3,332 1197 2.13
Classic C 1,488 383 2.66
C gcc #5 1,344 569 2.85
C gcc #4 1,352 1139 2.85
Classic C #5 3,308 569 2.86
Classic C #4 3,440 1139 2.86
Classic C #3 3,412 463 2.90
C gcc 1,248 383 5.38
C gcc #3 1,348 463 5.68
mandelbrot
source mem gz cpu
C gcc #6 31,244 1135 5.12
Classic C #8 31,984 782 6.10
C gcc #8 33,068 782 6.29
C gcc #4 32,704 799 13.81
C gcc #7 33,108 994 13.87
C gcc 29,692 822 13.91
C gcc #3 29,840 763 13.99
Classic C #9 33,084 694 14.50
C gcc #9 32,904 694 16.03
Classic C #2 1,324 400 24.76
C gcc #2 1,040 400 25.30
Classic C   Make Error  
Classic C #3   Make Error  
Classic C #6   Make Error  
Classic C #4   Make Error  
Classic C #7   Make Error  
pidigits
source mem gz cpu
Classic C #2 3,248 416 0.73
Classic C 2,960 452 0.73
C gcc 2,648 452 0.73
C gcc #2 2,920 416 0.74
regex-redux
source mem gz cpu
C gcc #5 152,220 1397 2.02
Classic C #5 154,992 1397 2.89
Classic C #2 103,584 1115 3.23
C gcc #2 103,084 1115 3.23
C gcc #4 152,056 1230 3.24
C gcc #3 103,540 1266 3.31
Classic C #4 154,664 1230 3.93
Classic C #3 105,984 1266 4.43
fasta
source mem gz cpu
C gcc #9 1,256 1463 0.78
Classic C #9 2,172 1463 1.00
C gcc #5 1,052 1281 1.30
Classic C #5 1,324 1281 1.89
C gcc #8 1,044 1293 2.74
C gcc #6 2,140 1930 2.76
C gcc #4 1,020 1240 3.06
Classic C #4 1,324 1240 3.18
C gcc #2 2,860 2268 3.25
C gcc #7 2,864 2011 3.28
Classic C #6 4,208 1930 3.47
C gcc 1,016 1206 3.67
Classic C 1,324 1206 4.01
Classic C #2 4,388 2268 4.23
Classic C #7 4,456 2011 4.25
C gcc #3 972 819 4.49
Classic C #3 1,468 819 4.67
Classic C #8 1,324 1293 4.94
k-nucleotide
source mem gz cpu
Classic C 129,488 1506 9.06
C gcc 130,156 1506 12.31
reverse-complement
source mem gz cpu
C gcc #7 499,132 1965 0.57
Classic C #7 499,672 1965 0.58
Classic C #8 499,644 1627 0.70
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
Classic C #5 994,548 647 1.48
Classic C #2 994,652 750 1.68
C gcc #4 500,416 709 3.49
Classic C #6 799,884 820 4.32
Classic C #4 500,800 709 4.70
binary-trees
source mem gz cpu
C gcc #2 168,384 809 4.32
C gcc #3 134,068 836 4.71
Classic C #2 170,096 809 4.92
Classic C #3 134,600 836 6.01
Classic C 263,732 654 17.98
C gcc 263,664 654 22.16
Classic C #5 351,656 908 29.09
C gcc #5 351,304 908 32.02
C gcc

11.2.0-19ubuntu1

Classic C

C Intel(R) 64 Classic
Version 2021.5.0
Build 20211109_000000