Perl VS Python benchmarks

Current benchmark data was generated on Thu Feb 01 2024, 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 1568ms 90ms 79.1MB 1510ms 40ms pypy 3.10.13
perl 1.pl timeout 0.0ms 77.8MB 4957ms 27ms perl 5.38.2
python 1.py timeout 0.0ms 41.3MB 4977ms 10ms cpython 3.12.1
python 1.py timeout 0.0ms 40.5MB 4763ms 223ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 116ms 0.7ms 62.6MB 80ms 20ms pypy 3.10.13
python 1.py 478ms 4.3ms 11.9MB 450ms 13ms pyston 3.8.12
python 1.py 732ms 6.5ms 13.1MB 713ms 0ms cpython 3.12.1
perl 1.pl 1805ms 29ms 14.1MB 1787ms 3ms perl 5.38.2

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 1945ms 8.0ms 62.7MB 1917ms 10ms pypy 3.10.13
python 5-m.py 2465ms 14ms 12.4MB 3553ms 1027ms pyston 3.8.12
python 5-m.py 2926ms 14ms 63.1MB 4217ms 773ms pypy 3.10.13
python 1.py 3002ms 24ms 8.1MB 2987ms 0ms pyston 3.8.12
python 5-m.py 3316ms 15ms 14.3MB 4393ms 993ms cpython 3.12.1
perl 1.pl 3533ms 37ms 11.0MB 3517ms 0ms perl 5.38.2
python 1.py 4481ms 71ms 9.3MB 4473ms 0ms cpython 3.12.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 267ms 4.6ms 61.3MB 240ms 7ms pypy 3.10.13
python 5-m.py 314ms 12ms 12.5MB 407ms 147ms pyston 3.8.12
python 1.py 316ms 1.5ms 8.1MB 303ms 3ms pyston 3.8.12
perl 1.pl 366ms 12ms 6.6MB 353ms 0ms perl 5.38.2
python 5-m.py 401ms 1.6ms 14.3MB 463ms 167ms cpython 3.12.1
python 1.py 469ms 14ms 9.3MB 457ms 0ms cpython 3.12.1
python 5-m.py 657ms 11ms 63.1MB 880ms 367ms pypy 3.10.13

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.38.2
python 1.py 12ms 0.9ms 7.6MB 0ms 0ms pyston 3.8.12
python 1.py 14ms 1.3ms 9.0MB 0ms 0ms cpython 3.12.1
python 1.py 30ms 1.2ms 48.6MB 8ms 8ms pypy 3.10.13

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 1386ms 17ms 60.4MB 1357ms 17ms pypy 3.10.13
python 1.py 2647ms 17ms 54.1MB 2617ms 10ms pypy 3.10.13
perl 2.pl timeout 0.0ms 6.3MB 4990ms 0ms perl 5.38.2
python 1.py timeout 0.0ms 9.1MB 4987ms 0ms cpython 3.12.1
python 2.py timeout 0.0ms 9.3MB 4990ms 0ms cpython 3.12.1
python 1.py timeout 0.0ms 8.3MB 4980ms 0ms pyston 3.8.12
python 2.py timeout 0.0ms 8.1MB 4983ms 0ms pyston 3.8.12

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 179ms 0.4ms 55.8MB 153ms 10ms pypy 3.10.13
python 1.py 305ms 5.4ms 54.0MB 283ms 10ms pypy 3.10.13
python 1.py 942ms 43ms 8.3MB 930ms 0ms pyston 3.8.12
python 2.py 1314ms 31ms 8.1MB 1300ms 0ms pyston 3.8.12
perl 2.pl 2562ms 54ms 6.3MB 2553ms 0ms perl 5.38.2
python 1.py 2986ms 131ms 9.1MB 2973ms 0ms cpython 3.12.1
python 2.py 3077ms 2.2ms 9.1MB 3063ms 0ms cpython 3.12.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 4.pl timeout 0.0ms 13.8MB 19783ms 10ms perl 5.38.2
python 8.py timeout 0.0ms 17.2MB 57ms 13ms cpython 3.12.1
python 8.py timeout 0.0ms 76.8MB 967ms 133ms pypy 3.10.13
python 8.py timeout 0.0ms 18.1MB 63ms 10ms 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 14.0MB 19403ms 13ms perl 5.38.2
python 8.py timeout 0.0ms 16.8MB 100ms 13ms cpython 3.12.1
python 8.py timeout 0.0ms 75.9MB 1767ms 440ms pypy 3.10.13
python 8.py timeout 0.0ms 17.8MB 150ms 30ms pyston 3.8.12

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 8-m.py 2161ms 17ms 76.3MB 6830ms 320ms pypy 3.10.13
perl 4-m.pl 3241ms 7.1ms 13.5MB 12600ms 10ms perl 5.38.2
python 8.py timeout 0.0ms 14.6MB 293ms 40ms cpython 3.12.1
python 8.py timeout 0.0ms 17.2MB 430ms 120ms pyston 3.8.12