Php VS Lua 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
lua 1.lua timeout 0.0ms 119.5MB 4937ms 47ms lua 5.4.4
lua 1.lua timeout 0.0ms 174.6MB 4930ms 50ms luajit 2.1.0-beta3
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
lua 1.lua 404ms 4.7ms 25.0MB 383ms 7ms luajit 2.1.0-beta3
php 1.php 781ms 1.5ms 62.3MB 750ms 17ms php 8.2.1
lua 1.lua 1057ms 15ms 17.3MB 1043ms 0ms lua 5.4.4

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
lua 1.lua 1.9ms 0.4ms 2.3MB 0ms 0ms luajit 2.1.0-beta3
lua 1.lua 2.1ms 0.8ms 1.5MB 0ms 0ms lua 5.4.4
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
php 1.php 4853ms 20ms 113.5MB 4810ms 23ms php 8.2.1
lua 1.lua timeout 0.0ms 159.2MB 4920ms 60ms lua 5.4.4
lua 1.lua timeout 0.0ms 180.9MB 4913ms 70ms luajit 2.1.0-beta3

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
php 1.php 1068ms 0.8ms 66.4MB 1030ms 23ms php 8.2.1
lua 1.lua 1517ms 29ms 36.2MB 1490ms 13ms luajit 2.1.0-beta3
lua 1.lua 2818ms 14ms 41.6MB 2790ms 10ms lua 5.4.4