Hack VS Wasm benchmarks

Current benchmark data was generated on Fri May 20 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 2001ms 12ms 40.9MB 1977ms 10ms wasmedgec 0.9.1
wasm 3.rs 2003ms 12ms 38.0MB 1960ms 27ms wasmer/llvm 2.2.1
wasm 5.rs 2010ms 5.6ms 24.9MB 1987ms 3ms wasmedgec 0.9.1
wasm 4.rs 2213ms 9.5ms 24.9MB 2197ms 0ms wasmedgec 0.9.1
wasm 5.rs 2617ms 4.8ms 22.3MB 2593ms 3ms wasmer/llvm 2.2.1
wasm 3.rs 2632ms 10ms 42.2MB 2607ms 10ms wasmtime 0.36.0
wasm 4.rs 2698ms 39ms 22.2MB 2670ms 13ms wasmer/llvm 2.2.1
wasm 5.rs 2882ms 50ms 58.7MB 2883ms 13ms node 16.15.0
wasm 3.rs 2936ms 43ms 74.8MB 2913ms 20ms node 16.15.0
wasm 4.rs 2969ms 12ms 58.8MB 2963ms 13ms node 16.15.0
wasm 4.rs 3209ms 19ms 26.3MB 3183ms 7ms wasmtime 0.36.0
wasm 5.rs 3225ms 37ms 26.3MB 3207ms 3ms wasmtime 0.36.0
hacklang 1.hack timeout 0.0ms 0.0MB 0ms 0ms hhvm 4.160.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 5.rs 196ms 0.7ms 10.9MB 183ms 0ms wasmedgec 0.9.1
wasm 3.rs 196ms 14ms 10.1MB 170ms 0ms wasmer/llvm 2.2.1
wasm 3.rs 198ms 4.8ms 12.9MB 183ms 0ms wasmedgec 0.9.1
wasm 4.rs 216ms 3.1ms 10.9MB 203ms 0ms wasmedgec 0.9.1
wasm 5.rs 253ms 10ms 8.1MB 237ms 0ms wasmer/llvm 2.2.1
wasm 4.rs 259ms 8.1ms 8.2MB 240ms 0ms wasmer/llvm 2.2.1
wasm 3.rs 261ms 16ms 14.3MB 233ms 0ms wasmtime 0.36.0
wasm 5.rs 310ms 7.3ms 12.4MB 293ms 0ms wasmtime 0.36.0
wasm 4.rs 316ms 9.1ms 12.4MB 303ms 0ms wasmtime 0.36.0
wasm 4.rs 347ms 6.1ms 44.5MB 350ms 10ms node 16.15.0
wasm 5.rs 356ms 15ms 44.3MB 367ms 3ms node 16.15.0
wasm 3.rs 356ms 18ms 49.2MB 350ms 13ms node 16.15.0
hacklang 1.hack 1312ms 4.7ms 185.1MB 1253ms 43ms hhvm 4.160.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 1337ms 61ms 8.5MB 1327ms 0ms wasmer/llvm 2.2.1
wasm 3.rs 1508ms 36ms 47.7MB 1560ms 3ms node 16.15.0
wasm 3.rs 1825ms 10ms 12.3MB 1810ms 0ms wasmtime 0.36.0
hacklang 1.hack 1939ms 42ms 173.6MB 1887ms 40ms hhvm 4.160.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 91ms 10ms 6.8MB 73ms 0ms wasmer/llvm 2.2.1
wasm 3.rs 124ms 1.7ms 11.0MB 113ms 0ms wasmtime 0.36.0
wasm 3.rs 215ms 3.8ms 48.3MB 257ms 7ms node 16.15.0
hacklang 1.hack 945ms 2.0ms 173.4MB 903ms 27ms hhvm 4.160.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 6.3ms 0.6ms 10.2MB 0ms 0ms wasmtime 0.36.0
wasm 1.rs 6.3ms 6.5ms 5.7MB 0ms 0ms wasmer/llvm 2.2.1
wasm 1.rs 9.0ms 0.7ms 8.6MB 0ms 0ms wasmedgec 0.9.1
wasm 1.rs 75ms 1.7ms 42.1MB 90ms 2ms node 16.15.0
hacklang 1.hack 752ms 2.1ms 169.3MB 706ms 34ms hhvm 4.160.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 1149ms 49ms 33.0MB 1127ms 7ms wasmedgec 0.9.1
wasm 1.rs 1284ms 26ms 30.0MB 1250ms 17ms wasmer/llvm 2.2.1
wasm 1.rs 1469ms 18ms 66.7MB 1470ms 13ms node 16.15.0
wasm 1.rs 1524ms 3.3ms 34.3MB 1503ms 3ms wasmtime 0.36.0
hacklang 1.hack 4692ms 18ms 237.9MB 4630ms 43ms hhvm 4.160.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 246ms 3.9ms 15.0MB 233ms 0ms wasmedgec 0.9.1
wasm 1.rs 277ms 16ms 12.2MB 250ms 0ms wasmer/llvm 2.2.1
wasm 1.rs 333ms 7.8ms 16.4MB 320ms 0ms wasmtime 0.36.0
wasm 1.rs 370ms 7.6ms 48.5MB 370ms 10ms node 16.15.0
hacklang 1.hack 1628ms 8.5ms 188.1MB 1580ms 33ms hhvm 4.160.0