The Computer Language
Benchmarks Game

Perl versus Python 3 fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

spectral-norm
source secs mem gz busy cpu load
Perl 25.68 12,092 555 101.06 98% 99% 98% 98%
Python 3 116.23 50,080 407 463.55 100% 100% 100% 100%
n-body
source secs mem gz busy cpu load
Perl 411.70 6,564 1429 435.04 2% 2% 55% 47%
Python 3 545.25 8,160 1196 558.88 1% 1% 1% 100%
k-nucleotide
source secs mem gz busy cpu load
Perl 37.86 1,253,064 652 132.61 84% 95% 87% 85%
Python 3 48.51 134,372 1967 185.66 94% 100% 94% 95%
reverse-complement
source secs mem gz busy cpu load
Perl 6.35 1,495,212 287 6.54 100% 2% 0% 0%
Python 3 7.15 1,005,204 814 10.62 81% 1% 47% 20%
fannkuch-redux
source secs mem gz busy cpu load
Perl 395.61 12,132 570 1,576.97 100% 99% 100% 100%
Python 3 366.43 47,608 950 1,448.16 100% 99% 100% 97%
pidigits
source secs mem gz busy cpu load
Perl 1.89 8,344 261 1.90 100% 1% 0% 0%
Python 3 1.29 11,976 567 1.30 0% 100% 1% 0%
fasta
source secs mem gz busy cpu load
Perl 61.34 55,252 871 61.71 0% 0% 100% 0%
Python 3 38.07 845,888 1947 75.85 23% 63% 66% 47%
binary-trees
source secs mem gz busy cpu load
Perl 84.89 2,519,528 761 309.94 98% 91% 88% 88%
Python 3 48.39 278,240 589 171.39 87% 88% 94% 86%
mandelbrot
source secs mem gz busy cpu load
Perl 532.78 43,996 586 2,130.59 100% 100% 100% 100%
Python 3 170.25 47,568 688 680.12 100% 100% 100% 100%
regex-redux
source secs mem gz busy cpu load
Perl 9.99 156,124 820 29.82 51% 96% 61% 91%
Python 3 1.37 404,320 1403 2.65 32% 41% 33% 88%
Perl

This is perl 5, version 32, subversion 0 (v5.32.0)
built for x86_64-linux-thread-multi

Python 3

Python 3.8.3