Php VS Python benchmarks

Current benchmark data was generated on Wed Jan 22 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 1189ms 1.9ms 95.8MB 1113ms 57ms pypy 3.10.14
php 1.php timeout 0.0ms 141.9MB 4957ms 23ms php 8.2.27
python 1.py timeout 0.0ms 40.9MB 4970ms 17ms cpython 3.13.1
python 1.py timeout 0.0ms 40.6MB 4760ms 227ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 96ms 2.4ms 68.1MB 67ms 20ms pypy 3.10.14
python 1.py 486ms 19ms 11.9MB 457ms 13ms pyston 3.8.12
php 1.php 619ms 7.3ms 62.7MB 590ms 13ms php 8.2.27
python 1.py 705ms 9.2ms 12.6MB 693ms 0ms cpython 3.13.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 12ms 1.1ms 7.6MB 0ms 0ms pyston 3.8.12
python 1.py 14ms 1.2ms 8.5MB 10ms 0ms cpython 3.13.1
python 1.py 28ms 0.6ms 51.0MB 10ms 8ms pypy 3.10.14
php 1.php 50ms 1.1ms 52.6MB 22ms 12ms php 8.2.27

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 2276ms 12ms 209.9MB 2153ms 103ms pypy 3.10.14
php 1.php 3744ms 64ms 113.9MB 3703ms 23ms php 8.2.27
python 1.py timeout 0.0ms 93.9MB 4953ms 33ms cpython 3.13.1
python 1.py timeout 0.0ms 130.4MB 4923ms 57ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 389ms 1.4ms 103.6MB 330ms 43ms pypy 3.10.14
php 1.php 826ms 9.2ms 67.1MB 787ms 23ms php 8.2.27
python 1.py 3030ms 33ms 37.1MB 3000ms 17ms cpython 3.13.1
python 1.py timeout 0.0ms 48.9MB 4937ms 47ms pyston 3.8.12