Php VS Go benchmarks

Current benchmark data was generated on Tue Apr 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
go 1.go 1240ms 17ms 54.9MB 1220ms 10ms tinygo 0.37.0
go 1-m.go 2400ms 32ms 42.0MB 5317ms 40ms go 1.24.1
php 1.php timeout 0.0ms 141.8MB 4963ms 23ms php 8.2.28

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 112ms 0.9ms 5.6MB 100ms 0ms tinygo 0.37.0
go 1-m.go 212ms 1.0ms 8.2MB 377ms 10ms go 1.24.1
php 1.php 623ms 2.8ms 63.1MB 587ms 23ms php 8.2.28

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 0.9ms 0.1ms 0.4MB 0ms 0ms tinygo 0.37.0
go 1.go 1.5ms 0.1ms 3.4MB 0ms 0ms go 1.24.1
php 1.php 52ms 1.0ms 52.8MB 20ms 20ms php 8.2.28

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 830ms 47ms 63.1MB 810ms 7ms tinygo 0.37.0
go 2.go 1142ms 24ms 55.0MB 1123ms 7ms tinygo 0.37.0
go 1-m.go 1484ms 11ms 49.2MB 3163ms 40ms go 1.24.1
go 2-m.go 1707ms 26ms 42.9MB 3750ms 37ms go 1.24.1
php 1.php 4055ms 54ms 114.0MB 4010ms 30ms php 8.2.28

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 179ms 3.9ms 9.8MB 163ms 0ms tinygo 0.37.0
go 2.go 217ms 6.8ms 17.1MB 203ms 3ms tinygo 0.37.0
go 1-m.go 334ms 0.8ms 12.2MB 673ms 23ms go 1.24.1
go 2-m.go 381ms 5.1ms 14.1MB 803ms 30ms go 1.24.1
php 1.php 842ms 8.7ms 67.2MB 803ms 20ms php 8.2.28