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 24.69 12,188 555 96.59 97% 99% 98% 97%
Python 3 118.40 22,912 407 470.86 99% 99% 99% 100%
n-body
source secs mem gz busy cpu load
Perl 419.75 6,388 1429 429.50 1% 1% 1% 100%
Python 3 586.17 8,012 1196 589.84 0% 0% 0% 100%
k-nucleotide
source secs mem gz busy cpu load
Perl 37.72 1,255,884 652 131.45 88% 89% 87% 85%
Python 3 46.37 239,472 1967 176.69 94% 95% 98% 94%
reverse-complement
source secs mem gz busy cpu load
Perl 6.36 1,495,132 287 6.52 0% 0% 2% 100%
Python 3 7.16 1,005,968 814 10.65 20% 53% 47% 29%
fannkuch-redux
source secs mem gz busy cpu load
Perl 392.54 12,116 570 1,568.84 100% 100% 100% 100%
Python 3 367.49 12,288 950 1,454.68 100% 98% 99% 98%
binary-trees
source secs mem gz busy cpu load
Perl 53.02 1,048,568 797 195.75 91% 88% 100% 90%
Python 3 49.35 278,628 589 174.26 95% 86% 86% 86%
pidigits
source secs mem gz busy cpu load
Perl 1.90 8,268 261 2.16 100% 2% 3% 9%
Python 3 1.28 12,336 567 1.30 1% 0% 1% 100%
fasta
source secs mem gz busy cpu load
Perl 58.08 55,188 871 59.16 1% 100% 1% 0%
Python 3 39.10 846,628 1947 70.52 43% 8% 61% 69%
mandelbrot
source secs mem gz busy cpu load
Perl 542.82 45,036 586 2,169.30 100% 100% 100% 100%
Python 3 172.58 12,216 688 689.62 100% 100% 100% 100%
regex-redux
source secs mem gz busy cpu load
Perl 10.10 157,208 820 31.98 96% 67% 93% 61%
Python 3 1.36 112,052 1403 2.64 40% 88% 32% 33%
Perl

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

Python 3

Python 3.9.0