Php VS Go benchmarks

Current benchmark data was generated on Sat Nov 16 2024, 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-m.go 2720ms 34ms 46.1MB 5730ms 43ms go 1.23.3
go 1.go 3817ms 45ms 51.5MB 3800ms 0ms tinygo 0.34.0
php 1.php timeout 0.0ms 142.1MB 4957ms 23ms php 8.2.25

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 239ms 2.7ms 8.1MB 393ms 13ms go 1.23.3
go 1.go 248ms 36ms 6.5MB 237ms 3ms tinygo 0.34.0
php 1.php 629ms 22ms 62.9MB 593ms 17ms php 8.2.25

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 0.7ms 0.1ms 0.1MB 0ms 0ms tinygo 0.34.0
go 1.go 1.4ms 0.1ms 3.4MB 0ms 0ms go 1.23.3
php 1.php 50ms 1.7ms 52.6MB 20ms 18ms php 8.2.25

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 1612ms 18ms 36.6MB 3263ms 33ms go 1.23.3
go 2-m.go 1871ms 71ms 43.0MB 3923ms 27ms go 1.23.3
go 1.go 2050ms 9.5ms 52.0MB 2030ms 3ms tinygo 0.34.0
go 2.go 3360ms 7.7ms 90.6MB 3333ms 10ms tinygo 0.34.0
php 1.php 3826ms 86ms 113.9MB 3780ms 30ms php 8.2.25

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 365ms 1.7ms 12.1MB 700ms 27ms go 1.23.3
go 2-m.go 410ms 1.5ms 13.9MB 847ms 13ms go 1.23.3
go 1.go 441ms 5.4ms 13.7MB 430ms 0ms tinygo 0.34.0
go 2.go 669ms 4.4ms 29.0MB 657ms 0ms tinygo 0.34.0
php 1.php 832ms 8.5ms 67.2MB 797ms 17ms php 8.2.25