The Computer Language
22.05 Benchmarks Game

Fastest cpu secs Perl versus Python 3

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
Perl #3 5,064 427 1,267.96
Python 3 #6 7,432 385 1,279.15
Python 3 #4 45,420 950 1,336.72
Perl #2 12,308 570 1,626.37
Perl 5,288 457 1,731.08
n-body
source mem gz cpu
Perl #2 6,280 1429 492.03
Python 3 7,756 1196 575.02
Python 3 #2 8,244 1242 592.71
spectral-norm
source mem gz cpu
Perl #4 12,044 555 92.70
Perl #5 7,732 340 99.89
Perl 7,708 333 105.24
Python 3 #6 9,332 328 436.79
Python 3 #8 48,336 407 472.82
Perl #2 7,040 343 484.05
Python 3 #7 48,400 417 494.32
Perl #3 18,328 850 498.71
mandelbrot
source mem gz cpu
Python 3 #7 46,192 688 706.10
Perl 62,064 586 1,883.51
Python 3 #5   Failed  
Python 3 #2   Timed Out  
pidigits
source mem gz cpu
Python 3 #3 11,968 567 1.13
Perl #4 8,356 261 1.84
Perl #2 8,368 389 1.96
Python 3 #4 8,668 342 4.06
Perl 12,616 463 9.93
Python 3 #2   Bad Output  
regex-redux
source mem gz cpu
Python 3 #2 111,680 1403 2.66
Python 3 458,264 512 17.86
Perl 205,584 464 21.87
Perl #2 204,960 710 28.74
Perl #3 157,276 854 29.80
Perl #4 157,228 820 29.95
Perl #5   Bad Output  
fasta
source mem gz cpu
Python 3 #2 8,184 1121 60.26
Python 3 #3 8,112 1003 60.50
Perl 55,124 871 62.41
Python 3 8,040 817 70.54
Python 3 #5 837,684 1947 71.74
Perl #4 6,336 966 129.28
Perl #2 6,224 922 198.31
k-nucleotide
source mem gz cpu
Perl #2 659,704 359 131.83
Perl 1,253,716 652 146.30
Perl #4 1,069,344 476 150.18
Python 3 #3 252,668 1967 172.53
Perl #3 1,147,148 513 184.94
Python 3 351,092 607 240.16
Python 3 #8 473,988 655 242.16
reverse-complement
source mem gz cpu
Perl #3 1,495,156 287 6.47
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
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
Perl #5 1,048,472 797 209.51
Python 3 #3 669,832 1238 230.73
Perl 599,520 395 252.39
Perl #4 2,519,768 761 274.10
Perl #3 2,200,608 648 390.15
Perl

This is perl 5, version 34
subversion 0 (v5.34.0)
x86_64-linux-thread-multi

Python 3

Python 3.10.4