Php VS Python benchmarks

Current benchmark data was generated on Fri Aug 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 1165ms 6.5ms 96.8MB 1107ms 47ms pypy 3.11.13
php 1.php timeout 0.0ms 141.5MB 4970ms 20ms php 8.2.29
python 1.py timeout 0.0ms 41.0MB 4967ms 23ms cpython 3.13.5
python 1.py timeout 0.0ms 40.5MB 4733ms 253ms 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.5ms 68.3MB 63ms 17ms pypy 3.11.13
python 1.py 492ms 6.9ms 11.9MB 470ms 10ms pyston 3.8.12
php 1.php 618ms 4.3ms 62.6MB 587ms 17ms php 8.2.29
python 1.py 734ms 16ms 12.9MB 723ms 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 11ms 0.9ms 7.8MB 0ms 0ms pyston 3.8.12
python 1.py 13ms 0.8ms 8.8MB 0ms 0ms cpython 3.13.5
python 1.py 29ms 0.8ms 52.2MB 10ms 10ms pypy 3.11.13
php 1.php 48ms 1.4ms 52.2MB 18ms 20ms php 8.2.29

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 2182ms 14ms 204.7MB 2060ms 107ms pypy 3.11.13
php 1.php 3710ms 17ms 113.8MB 3673ms 27ms php 8.2.29
python 1.py timeout 0.0ms 94.1MB 4957ms 33ms cpython 3.13.5
python 1.py timeout 0.0ms 130.4MB 4937ms 53ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 375ms 1.4ms 105.3MB 317ms 43ms pypy 3.11.13
php 1.php 828ms 8.5ms 66.8MB 793ms 23ms php 8.2.29
python 1.py 3001ms 36ms 37.4MB 2973ms 13ms cpython 3.13.5
python 1.py timeout 0.0ms 48.9MB 4940ms 47ms pyston 3.8.12