Php VS Go benchmarks

Current benchmark data was generated on Thu Jul 13 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
go 1.go 3509ms 41ms 45.0MB 5013ms 43ms go 1.20.6
go 1.go 4400ms 25ms 50.6MB 4380ms 3ms tinygo 0.28.1
php 1.php timeout 0.0ms 141.1MB 4960ms 13ms php 8.2.8

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 308ms 4.5ms 8.1MB 397ms 0ms go 1.20.6
go 1.go 440ms 1.4ms 6.9MB 427ms 0ms tinygo 0.28.1
php 1.php 798ms 1.5ms 62.3MB 767ms 17ms php 8.2.8

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 1.6ms 0.4ms 0.0MB 0ms 0ms tinygo 0.28.1
go 1.go 3.0ms 0.2ms 2.9MB 0ms 0ms go 1.20.6
php 1.php 46ms 1.9ms 51.3MB 24ms 8ms php 8.2.8

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 2080ms 20ms 37.6MB 2947ms 27ms go 1.20.6
go 2.go 2382ms 46ms 49.9MB 3403ms 57ms go 1.20.6
go 1.go 2858ms 2.3ms 51.9MB 2840ms 3ms tinygo 0.28.1
go 2.go 4300ms 6.9ms 120.1MB 4273ms 10ms tinygo 0.28.1
php 1.php 4890ms 59ms 113.4MB 4853ms 20ms php 8.2.8

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 444ms 5.6ms 12.3MB 607ms 7ms go 1.20.6
go 2.go 510ms 1.8ms 13.2MB 720ms 7ms go 1.20.6
go 1.go 607ms 1.8ms 13.1MB 593ms 0ms tinygo 0.28.1
go 2.go 833ms 2.9ms 29.9MB 820ms 0ms tinygo 0.28.1
php 1.php 1078ms 10ms 66.6MB 1053ms 10ms php 8.2.8