Php VS Wasm 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
wasm 5.rs 2180ms 20ms 31.1MB 2160ms 3ms wasmedgec 0.11.2
wasm 3.rs 2185ms 45ms 47.8MB 2160ms 10ms wasmedgec 0.11.2
wasm 4.rs 2373ms 18ms 30.8MB 2353ms 7ms wasmedgec 0.11.2
wasm 3.rs 2613ms 35ms 42.6MB 2580ms 17ms wasmtime 5.0.0
wasm 5.rs 2867ms 15ms 26.8MB 2853ms 0ms wasmtime 5.0.0
wasm 5.rs 2870ms 20ms 58.4MB 2873ms 10ms node 16.19.0
wasm 3.rs 2889ms 47ms 74.7MB 2880ms 20ms node 16.19.0
wasm 4.rs 2899ms 48ms 58.5MB 2900ms 10ms node 16.19.0
wasm 4.rs 3187ms 20ms 26.8MB 3170ms 3ms wasmtime 5.0.0
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
wasm 3.rs 202ms 9.8ms 19.8MB 187ms 0ms wasmedgec 0.11.2
wasm 5.rs 204ms 4.2ms 17.8MB 190ms 0ms wasmedgec 0.11.2
wasm 4.rs 221ms 0.7ms 17.7MB 207ms 0ms wasmedgec 0.11.2
wasm 3.rs 238ms 3.7ms 14.7MB 220ms 0ms wasmtime 5.0.0
wasm 5.rs 267ms 1.0ms 12.8MB 253ms 0ms wasmtime 5.0.0
wasm 4.rs 303ms 11ms 12.8MB 287ms 0ms wasmtime 5.0.0
wasm 4.rs 337ms 6.3ms 44.6MB 343ms 0ms node 16.19.0
wasm 5.rs 337ms 3.3ms 44.1MB 340ms 13ms node 16.19.0
wasm 3.rs 340ms 9.8ms 46.0MB 343ms 3ms node 16.19.0
php 1.php 781ms 1.5ms 62.3MB 750ms 17ms php 8.2.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 6.0ms 0.3ms 10.8MB 0ms 0ms wasmtime 5.0.0
wasm 1.rs 6.3ms 0.3ms 15.9MB 0ms 0ms wasmedgec 0.11.2
php 1.php 48ms 3.8ms 51.3MB 22ms 10ms php 8.2.1
wasm 1.rs 81ms 1.5ms 43.3MB 96ms 4ms node 16.19.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 1239ms 32ms 39.7MB 1210ms 17ms wasmedgec 0.11.2
wasm 1.rs 1455ms 25ms 34.9MB 1430ms 7ms wasmtime 5.0.0
wasm 1.rs 1475ms 1.2ms 66.9MB 1473ms 13ms node 16.19.0
php 1.php 4853ms 20ms 113.5MB 4810ms 23ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 261ms 1.5ms 20.4MB 247ms 0ms wasmedgec 0.11.2
wasm 1.rs 306ms 2.3ms 17.1MB 290ms 0ms wasmtime 5.0.0
wasm 1.rs 373ms 8.1ms 49.6MB 377ms 7ms node 16.19.0
php 1.php 1068ms 0.8ms 66.4MB 1030ms 23ms php 8.2.1