Php VS Javascript benchmarks

Current benchmark data was generated on Sun Jan 29 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
javascript 1.js 1311ms 115ms 253.9MB 1557ms 67ms bun 0.5.1
javascript 1.js 3548ms 72ms 239.0MB 2617ms 1197ms node 19.5.0
php 1.php timeout 0.0ms 141.0MB 4947ms 33ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1.js 121ms 2.4ms 101.4MB 103ms 20ms bun 0.5.1
javascript 1.js 170ms 5.1ms 70.0MB 153ms 20ms node 19.5.0
php 1.php 787ms 4.5ms 62.3MB 757ms 10ms php 8.2.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1.js 15ms 1.1ms 55.5MB 0ms 0ms bun 0.5.1
javascript 1.js 43ms 0.7ms 43.1MB 30ms 2ms node 19.5.0
php 1.php 47ms 1.6ms 50.8MB 22ms 12ms php 8.2.1

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1.js 742ms 11ms 158.6MB 820ms 33ms bun 0.5.1
javascript 1.js 773ms 6.5ms 122.2MB 777ms 57ms node 19.5.0
php 1.php 4872ms 54ms 113.2MB 4823ms 30ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1.js 172ms 1.9ms 108.9MB 163ms 13ms bun 0.5.1
javascript 1.js 228ms 7.2ms 90.2MB 213ms 33ms node 19.5.0
php 1.php 1068ms 6.3ms 66.3MB 1037ms 17ms php 8.2.1