Perl VS Python benchmarks

Current benchmark data was generated on Tue Apr 01 2025, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1)

* -m in a file name stands for multi-threading or multi-processing

* -i in a file name stands for direct intrinsics usage. (Usage of simd intrinsics via libraries is not counted)

* -ffi in a file name stands for non-stdlib FFI usage

* (You may find time < time(user) + time(sys) for some non-parallelized programs, the overhead is from GC or JIT compiler, which are allowed to take advantage of multi-cores as that's more close to real-world scenarios.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 1182ms 8.2ms 96.2MB 1120ms 47ms pypy 3.10.16
perl 1.pl timeout 0.0ms 77.8MB 4957ms 30ms perl 5.40.1
python 1.py timeout 0.0ms 40.8MB 4963ms 23ms cpython 3.13.2
python 1.py timeout 0.0ms 40.5MB 4737ms 247ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 95ms 3.4ms 68.6MB 67ms 17ms pypy 3.10.16
python 1.py 478ms 2.9ms 11.9MB 453ms 10ms pyston 3.8.12
python 1.py 732ms 24ms 12.6MB 720ms 0ms cpython 3.13.2
perl 1.pl 1821ms 7.9ms 14.4MB 1807ms 0ms perl 5.40.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 1868ms 39ms 88.8MB 1827ms 30ms pypy 3.10.16
python 5-m.py 2268ms 8.6ms 65.4MB 3480ms 850ms pypy 3.10.16
python 5-m.py 2448ms 28ms 12.5MB 3507ms 1017ms pyston 3.8.12
python 1.py 3055ms 111ms 8.1MB 3037ms 0ms pyston 3.8.12
python 5-m.py 3389ms 42ms 13.6MB 4500ms 943ms cpython 3.13.2
perl 1.pl 3620ms 21ms 10.9MB 3607ms 0ms perl 5.40.1
python 1.py 4744ms 95ms 8.6MB 4730ms 0ms cpython 3.13.2

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 256ms 2.4ms 63.3MB 230ms 10ms pypy 3.10.16
python 5-m.py 311ms 0.4ms 12.5MB 400ms 143ms pyston 3.8.12
python 1.py 329ms 29ms 8.1MB 317ms 0ms pyston 3.8.12
perl 1.pl 371ms 2.6ms 6.6MB 360ms 0ms perl 5.40.1
python 5-m.py 410ms 2.7ms 13.6MB 490ms 157ms cpython 3.13.2
python 5-m.py 442ms 1.0ms 65.3MB 737ms 313ms pypy 3.10.16
python 1.py 487ms 1.7ms 8.8MB 477ms 0ms cpython 3.13.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 2.7ms 0.2ms 5.3MB 0ms 0ms perl 5.40.1
python 1.py 12ms 1.2ms 7.6MB 0ms 0ms pyston 3.8.12
python 1.py 14ms 0.7ms 8.6MB 10ms 0ms cpython 3.13.2
python 1.py 28ms 0.6ms 51.6MB 10ms 10ms pypy 3.10.16

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 1356ms 8.7ms 60.2MB 1330ms 10ms pypy 3.10.16
python 1.py 2651ms 14ms 57.2MB 2627ms 10ms pypy 3.10.16
perl 2.pl timeout 0.0ms 6.1MB 4990ms 0ms perl 5.40.1
python 1.py timeout 0.0ms 8.6MB 4990ms 0ms cpython 3.13.2
python 2.py timeout 0.0ms 8.8MB 4990ms 0ms cpython 3.13.2
python 1.py timeout 0.0ms 8.3MB 4990ms 0ms pyston 3.8.12
python 2.py timeout 0.0ms 8.1MB 4990ms 0ms pyston 3.8.12

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 180ms 1.9ms 57.9MB 160ms 10ms pypy 3.10.16
python 1.py 308ms 8.8ms 57.1MB 287ms 10ms pypy 3.10.16
python 1.py 936ms 17ms 8.3MB 923ms 0ms pyston 3.8.12
python 2.py 1303ms 12ms 8.1MB 1290ms 0ms pyston 3.8.12
perl 2.pl 2724ms 26ms 6.1MB 2713ms 0ms perl 5.40.1
python 1.py 3020ms 81ms 8.8MB 3010ms 0ms cpython 3.13.2
python 2.py 3178ms 29ms 8.8MB 3167ms 0ms cpython 3.13.2

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 4.pl timeout 0.0ms 9.9MB 19727ms 10ms perl 5.40.1
python 8.py timeout 0.0ms 14.6MB 30ms 10ms cpython 3.13.2
python 8.py timeout 0.0ms 96.1MB 793ms 83ms pypy 3.10.16
python 8.py timeout 0.0ms 14.2MB 40ms 7ms pyston 3.8.12

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 4.pl timeout 0.0ms 10.1MB 19560ms 10ms perl 5.40.1
python 8.py timeout 0.0ms 14.4MB 47ms 10ms cpython 3.13.2
python 8.py timeout 0.0ms 96.8MB 1297ms 187ms pypy 3.10.16
python 8.py timeout 0.0ms 13.7MB 57ms 17ms pyston 3.8.12

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 8-m.py 1947ms 12ms 93.2MB 6353ms 250ms pypy 3.10.16
perl 4-m.pl 3427ms 15ms 9.4MB 13227ms 3ms perl 5.40.1
python 8.py timeout 0.0ms 14.0MB 80ms 23ms cpython 3.13.2
python 8.py timeout 0.0ms 13.4MB 143ms 33ms pyston 3.8.12