Elixir VS Wasm benchmarks

Current benchmark data was generated on Thu Sep 22 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.)

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 1268ms 0.5ms 8.0MB 1257ms 0ms wasmer/llvm 2.3.0
wasm 3.rs 1530ms 20ms 48.2MB 1570ms 20ms node 16.17.0
wasm 3.rs 1588ms 41ms 12.6MB 1573ms 0ms wasmtime 1.0.0
wasm 3.rs 1938ms 4.0ms 22.6MB 1920ms 3ms wasmedgec 0.11.0
elixir 1.ex 4743ms 26ms 53.5MB 4777ms 117ms elixir 13.1.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 84ms 0.8ms 7.0MB 70ms 0ms wasmer/llvm 2.3.0
wasm 3.rs 105ms 3.6ms 11.2MB 93ms 0ms wasmtime 1.0.0
wasm 3.rs 134ms 0.6ms 19.8MB 123ms 0ms wasmedgec 0.11.0
wasm 3.rs 216ms 4.3ms 48.2MB 267ms 7ms node 16.17.0
elixir 1.ex 509ms 4.1ms 50.6MB 543ms 43ms elixir 13.1.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 465ms 0.4ms 7.4MB 453ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 479ms 1.1ms 20.2MB 463ms 3ms wasmedgec 0.11.0
wasm 1.rs 636ms 30ms 12.1MB 627ms 0ms wasmtime 1.0.0
wasm 1.rs 708ms 1.5ms 49.7MB 747ms 13ms node 16.17.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 121ms 0.4ms 6.5MB 110ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 131ms 0.8ms 21.6MB 120ms 0ms wasmedgec 0.11.0
wasm 1.rs 167ms 8.2ms 11.6MB 160ms 0ms wasmtime 1.0.0
wasm 1.rs 272ms 3.4ms 48.8MB 317ms 7ms node 16.17.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 2.7ms 0.5ms 4.9MB 0ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 6.0ms 0.9ms 9.2MB 0ms 0ms wasmtime 1.0.0
wasm 1.rs 8.5ms 2.6ms 18.4MB 0ms 0ms wasmedgec 0.11.0
wasm 1.rs 83ms 1.1ms 43.5MB 94ms 6ms node 16.17.0
elixir 1.ex 216ms 4.1ms 47.8MB 240ms 34ms elixir 13.1.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 3010ms 8.2ms 7.0MB 2990ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 3124ms 6.9ms 18.9MB 3107ms 0ms wasmedgec 0.11.0
wasm 2.rs 3380ms 1.0ms 11.3MB 3370ms 0ms wasmtime 1.0.0
wasm 2.rs 3675ms 39ms 48.1MB 3717ms 10ms node 16.17.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 709ms 3.6ms 6.3MB 697ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 745ms 5.2ms 19.6MB 727ms 0ms wasmedgec 0.11.0
wasm 2.rs 802ms 0.3ms 10.9MB 790ms 0ms wasmtime 1.0.0
wasm 2.rs 961ms 7.8ms 48.7MB 1007ms 10ms node 16.17.0
elixir 1.ex 1308ms 3.9ms 46.6MB 1347ms 133ms elixir 13.1.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 4126ms 1.0ms 19.2MB 4113ms 0ms wasmedgec 0.11.0
wasm 7.rs 4194ms 1.2ms 6.0MB 4180ms 0ms wasmer/llvm 2.3.0
wasm 7.rs 4266ms 0.6ms 18.7MB 4257ms 0ms wasmedgec 0.11.0
wasm 2.rs 4298ms 5.4ms 48.2MB 4320ms 10ms node 16.17.0
wasm 2.rs 4396ms 1.1ms 6.1MB 4380ms 0ms wasmer/llvm 2.3.0
wasm 7.rs 4506ms 11ms 52.0MB 4527ms 7ms node 16.17.0
wasm 2.rs 4534ms 12ms 11.0MB 4520ms 0ms wasmtime 1.0.0
wasm 7.rs 4610ms 2.4ms 10.9MB 4600ms 0ms wasmtime 1.0.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 1039ms 0.6ms 19.2MB 1027ms 0ms wasmedgec 0.11.0
wasm 7.rs 1052ms 1.1ms 6.0MB 1040ms 0ms wasmer/llvm 2.3.0
wasm 7.rs 1074ms 1.0ms 18.6MB 1063ms 0ms wasmedgec 0.11.0
wasm 2.rs 1102ms 1.1ms 6.2MB 1090ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 1143ms 3.4ms 48.7MB 1177ms 3ms node 16.17.0
wasm 2.rs 1146ms 1.0ms 12.9MB 1133ms 0ms wasmtime 1.0.0
wasm 7.rs 1160ms 0.2ms 11.5MB 1147ms 0ms wasmtime 1.0.0
wasm 7.rs 1207ms 2.4ms 48.3MB 1230ms 10ms node 16.17.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 7.rs 266ms 0.6ms 4.9MB 253ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 267ms 0.4ms 18.5MB 253ms 0ms wasmedgec 0.11.0
wasm 7.rs 277ms 2.1ms 19.1MB 263ms 0ms wasmedgec 0.11.0
wasm 2.rs 279ms 0.3ms 4.9MB 263ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 293ms 0.3ms 9.7MB 280ms 0ms wasmtime 1.0.0
wasm 7.rs 296ms 0.3ms 9.4MB 283ms 0ms wasmtime 1.0.0
wasm 2.rs 366ms 5.1ms 48.3MB 397ms 0ms node 16.17.0
wasm 7.rs 379ms 1.5ms 48.6MB 397ms 13ms node 16.17.0
elixir 1.ex timeout 0.0ms 0.0MB 0ms 0ms elixir 13.1.0