Php VS Zig benchmarks

Current benchmark data was generated on Sat Jan 28 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -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
zig 1.zig 2472ms 47ms 49.1MB 2443ms 13ms zig 0.11.0-dev.1479+97b1a9bb6
php 1.php timeout 0.0ms 141.1MB 4953ms 33ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 187ms 2.1ms 7.1MB 173ms 0ms zig 0.11.0-dev.1479+97b1a9bb6
php 1.php 781ms 1.5ms 62.3MB 750ms 17ms php 8.2.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 1.7ms 0.7ms 1.0MB 0ms 0ms zig 0.11.0-dev.1479+97b1a9bb6
php 1.php 48ms 3.8ms 51.3MB 22ms 10ms php 8.2.1

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 1254ms 52ms 41.1MB 1230ms 3ms zig 0.11.0-dev.1479+97b1a9bb6
php 1.php 4853ms 20ms 113.5MB 4810ms 23ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
zig 1.zig 229ms 7.2ms 11.0MB 210ms 0ms zig 0.11.0-dev.1479+97b1a9bb6
php 1.php 1068ms 0.8ms 66.4MB 1030ms 23ms php 8.2.1