Php VS Python benchmarks

Current benchmark data was generated on Sun Jul 13 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 1162ms 7.5ms 96.8MB 1097ms 47ms pypy 3.11.13
php 1.php timeout 0.0ms 141.6MB 4960ms 27ms php 8.2.29
python 1.py timeout 0.0ms 41.0MB 4973ms 10ms cpython 3.13.5
python 1.py timeout 0.0ms 40.5MB 4743ms 240ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 94ms 1.5ms 68.2MB 67ms 13ms pypy 3.11.13
python 1.py 478ms 3.6ms 11.9MB 457ms 10ms pyston 3.8.12
php 1.php 625ms 2.2ms 62.6MB 590ms 20ms php 8.2.29
python 1.py 727ms 3.3ms 12.9MB 717ms 0ms cpython 3.13.5

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 12ms 0.8ms 7.6MB 0ms 0ms pyston 3.8.12
python 1.py 14ms 1.2ms 8.8MB 10ms 0ms cpython 3.13.5
python 1.py 30ms 0.8ms 52.3MB 10ms 10ms pypy 3.11.13
php 1.php 47ms 1.0ms 52.6MB 18ms 16ms php 8.2.29

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 2184ms 9.5ms 204.9MB 2073ms 97ms pypy 3.11.13
php 1.php 3739ms 55ms 113.6MB 3700ms 27ms php 8.2.29
python 1.py timeout 0.0ms 94.1MB 4960ms 27ms cpython 3.13.5
python 1.py timeout 0.0ms 130.4MB 4940ms 47ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 378ms 3.7ms 105.2MB 320ms 47ms pypy 3.11.13
php 1.php 830ms 14ms 67.0MB 793ms 20ms php 8.2.29
python 1.py 2994ms 19ms 37.4MB 2970ms 10ms cpython 3.13.5
python 1.py timeout 0.0ms 48.9MB 4943ms 43ms pyston 3.8.12