Php VS Wasm benchmarks

Current benchmark data was generated on Mon Oct 03 2022, 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 3.rs 1977ms 9.3ms 52.8MB 1950ms 10ms wasmedgec 0.11.0
wasm 3.rs 2038ms 3.5ms 37.8MB 2000ms 17ms wasmer/llvm 2.3.0
wasm 5.rs 2088ms 62ms 34.2MB 2070ms 3ms wasmedgec 0.11.0
wasm 4.rs 2222ms 1.9ms 35.0MB 2200ms 7ms wasmedgec 0.11.0
wasm 4.rs 2387ms 3.6ms 22.0MB 2357ms 10ms wasmer/llvm 2.3.0
wasm 3.rs 2454ms 12ms 42.6MB 2427ms 10ms wasmtime 1.0.1
wasm 5.rs 2507ms 3.5ms 21.9MB 2487ms 7ms wasmer/llvm 2.3.0
wasm 5.rs 2667ms 46ms 58.2MB 2683ms 3ms node 16.17.0
wasm 3.rs 2758ms 54ms 74.6MB 2770ms 7ms node 16.17.0
wasm 4.rs 2777ms 52ms 58.3MB 2783ms 10ms node 16.17.0
wasm 5.rs 2895ms 18ms 26.8MB 2873ms 3ms wasmtime 1.0.1
wasm 4.rs 3138ms 8.6ms 26.7MB 3120ms 0ms wasmtime 1.0.1
php 1.php timeout 0.0ms 0.0MB 0ms 0ms php 8.1.10

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 191ms 2.0ms 23.0MB 180ms 0ms wasmedgec 0.11.0
wasm 3.rs 193ms 0.8ms 9.8MB 180ms 0ms wasmer/llvm 2.3.0
wasm 5.rs 200ms 0.5ms 20.8MB 183ms 0ms wasmedgec 0.11.0
wasm 4.rs 216ms 0.4ms 21.0MB 207ms 0ms wasmedgec 0.11.0
wasm 4.rs 226ms 0.7ms 8.0MB 213ms 0ms wasmer/llvm 2.3.0
wasm 3.rs 232ms 1.0ms 14.7MB 217ms 3ms wasmtime 1.0.1
wasm 5.rs 238ms 0.3ms 7.9MB 220ms 0ms wasmer/llvm 2.3.0
wasm 5.rs 279ms 4.8ms 12.8MB 263ms 0ms wasmtime 1.0.1
wasm 4.rs 303ms 2.2ms 12.7MB 290ms 0ms wasmtime 1.0.1
wasm 5.rs 320ms 4.5ms 44.1MB 333ms 3ms node 16.17.0
wasm 4.rs 331ms 1.3ms 44.1MB 347ms 0ms node 16.17.0
wasm 3.rs 331ms 1.1ms 46.6MB 340ms 7ms node 16.17.0
php 1.php timeout 0.0ms 0.0MB 0ms 0ms php 8.1.10

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 2.9ms 0.7ms 4.9MB 0ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 6.6ms 1.2ms 10.8MB 0ms 0ms wasmtime 1.0.1
wasm 1.rs 6.9ms 0.5ms 18.7MB 0ms 0ms wasmedgec 0.11.0
php 1.php 41ms 2.4ms 48.1MB 16ms 8ms php 8.1.10
wasm 1.rs 80ms 1.1ms 43.5MB 96ms 4ms node 16.17.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 1090ms 26ms 43.1MB 1067ms 7ms wasmedgec 0.11.0
wasm 1.rs 1243ms 4.5ms 29.7MB 1213ms 13ms wasmer/llvm 2.3.0
wasm 1.rs 1378ms 38ms 67.7MB 1377ms 17ms node 16.17.0
wasm 1.rs 1427ms 8.8ms 34.7MB 1410ms 3ms wasmtime 1.0.1
php 1.php timeout 0.0ms 0.0MB 0ms 0ms php 8.1.10

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 233ms 0.5ms 25.0MB 220ms 0ms wasmedgec 0.11.0
wasm 1.rs 266ms 0.9ms 11.9MB 257ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 309ms 3.4ms 16.9MB 297ms 0ms wasmtime 1.0.1
wasm 1.rs 351ms 1.7ms 49.4MB 357ms 17ms node 16.17.0
php 1.php timeout 0.0ms 0.0MB 0ms 0ms php 8.1.10