The Computer Language
22.05 Benchmarks Game

Fastest cpu secs Python 3 versus Go

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
Go #3 2,260 969 32.88
Go 2,956 900 47.36
Go #2 11,316 896 47.56
Python 3 #6 7,432 385 1,279.15
Python 3 #4 45,420 950 1,336.72
n-body
source mem gz cpu
Go #3 1,136 1200 6.38
Go 1,136 1310 6.58
Go #2 1,132 1215 6.94
Python 3 7,756 1196 575.02
Python 3 #2 8,244 1242 592.71
spectral-norm
source mem gz cpu
Go 2,452 411 5.33
Go #4 1,952 548 5.67
Go #2 1,420 668 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
Go #4 33,812 905 14.85
Go #3 34,028 894 14.91
Go 32,600 823 19.58
Go #2 33,196 837 27.07
Go #6 32,764 700 27.25
Python 3 #7 46,192 688 706.10
Python 3 #5   Failed  
Python 3 #2   Timed Out  
pidigits
source mem gz cpu
Go #4 8,732 683 0.87
Python 3 #3 11,968 567 1.13
Go #3 9,320 603 1.18
Go 9,496 708 1.21
Go #2 9,032 733 1.59
Go #8 9,924 720 2.54
Python 3 #4 8,668 342 4.06
Go #7 8,620 696 5.05
Python 3 #2   Bad Output  
regex-redux
source mem gz cpu
Python 3 #2 111,680 1403 2.66
Go #5 306,476 810 5.97
Python 3 458,264 512 17.86
Go #4 355,844 829 34.99
Go #3 358,472 829 67.28
Go 297,048 741 68.45
fasta
source mem gz cpu
Go 1,112 1053 3.64
Go #2 10,980 1404 3.84
Go #3 3,168 1358 3.98
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
Go #7 159,432 1607 28.49
Go #6 149,712 1590 29.40
Go #4 144,528 1543 30.22
Go #3 149,984 1722 30.25
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
Go #2 826,796 611 1.94
Go #3 826,544 605 2.13
Go #5 1,483,756 996 2.26
Go #6 1,289,572 1338 2.48
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
Go   Failed  
binary-trees
source mem gz cpu
Go #6 411,424 611 29.23
Go #2 632,396 666 48.67
Go #3 328,700 799 50.09
Go #5 394,800 950 50.52
Go 240,292 482 51.02
Go #7 259,088 525 51.41
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

Go

go version go1.18 linux/amd64