The Computer Language
22.05 Benchmarks Game

Fastest cpu secs Python 3 versus C gcc

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 gcc #4 964 1183 13.89
C gcc #5 1,072 910 29.38
C gcc #3 1,016 567 42.18
C gcc 988 508 43.27
C gcc #2 1,140 1557 45.01
Python 3 #6 7,432 385 1,279.15
Python 3 #4 45,420 950 1,336.72
n-body
source mem gz cpu
C gcc #9 992 1633 2.12
C gcc #8 8 1391 4.10
C gcc #4 1,304 1490 4.44
C gcc #5 1,020 1429 6.10
C gcc #7 1,300 1244 6.79
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
Python 3 7,756 1196 575.02
Python 3 #2 8,244 1242 592.71
spectral-norm
source mem gz cpu
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 gcc 1,248 383 5.38
C gcc #3 1,348 463 5.68
Python 3 #6 9,332 328 436.79
Python 3 #8 48,336 407 472.82
Python 3 #7 48,400 417 494.32
mandelbrot
source mem gz cpu
C gcc #6 31,244 1135 5.12
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
C gcc #9 32,904 694 16.03
C gcc #2 1,040 400 25.30
Python 3 #7 46,192 688 706.10
Python 3 #5   Failed  
Python 3 #2   Timed Out  
pidigits
source mem gz cpu
C gcc 2,648 452 0.73
C gcc #2 2,920 416 0.74
Python 3 #3 11,968 567 1.13
Python 3 #4 8,668 342 4.06
Python 3 #2   Bad Output  
regex-redux
source mem gz cpu
C gcc #5 152,220 1397 2.02
Python 3 #2 111,680 1403 2.66
C gcc #2 103,084 1115 3.23
C gcc #4 152,056 1230 3.24
C gcc #3 103,540 1266 3.31
Python 3 458,264 512 17.86
fasta
source mem gz cpu
C gcc #9 1,256 1463 0.78
C gcc #5 1,052 1281 1.30
C gcc #8 1,044 1293 2.74
C gcc #6 2,140 1930 2.76
C gcc #4 1,020 1240 3.06
C gcc #2 2,860 2268 3.25
C gcc #7 2,864 2011 3.28
C gcc 1,016 1206 3.67
C gcc #3 972 819 4.49
Python 3 #2 8,184 1121 60.26
Python 3 #3 8,112 1003 60.50
Python 3 8,040 817 70.54
Python 3 #5 837,684 1947 71.74
k-nucleotide
source mem gz cpu
C gcc 130,156 1506 12.31
Python 3 #3 252,668 1967 172.53
Python 3 351,092 607 240.16
Python 3 #8 473,988 655 242.16
reverse-complement
source mem gz cpu
C gcc #7 499,132 1965 0.57
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 gcc #4 500,416 709 3.49
Python 3 #2 1,786,488 434 9.38
Python 3 1,979,276 479 9.63
Python 3 #6 1,005,184 814 10.64
Python 3 #4 4,001,684 335 12.31
binary-trees
source mem gz cpu
C gcc #2 168,384 809 4.32
C gcc #3 134,068 836 4.71
C gcc 263,664 654 22.16
C gcc #5 351,304 908 32.02
Python 3 #2 270,872 338 148.09
Python 3 #5 273,284 660 172.44
Python 3 #4 456,220 472 176.37
Python 3 282,996 589 178.66
Python 3 #3 669,832 1238 230.73
Python 3

Python 3.10.4

C gcc

11.2.0-19ubuntu1