Perl 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
perl 1.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.36.0

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
perl 1.pl 2233ms 28ms 14.3MB 2210ms 7ms perl 5.36.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 338ms 1.0ms 6.2MB 320ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 349ms 2.0ms 11.2MB 333ms 3ms wasmtime 1.0.1
wasm 1.rs 358ms 0.6ms 19.1MB 340ms 0ms wasmedgec 0.11.0
wasm 1.rs 464ms 3.0ms 43.8MB 477ms 7ms node 16.17.0
perl 1.pl 4504ms 60ms 11.1MB 4493ms 0ms perl 5.36.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 38ms 0.7ms 6.2MB 27ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 43ms 0.8ms 9.5MB 30ms 0ms wasmtime 1.0.1
wasm 1.rs 45ms 0.3ms 19.0MB 30ms 0ms wasmedgec 0.11.0
wasm 1.rs 125ms 2.6ms 43.7MB 150ms 0ms node 16.17.0
perl 1.pl 458ms 4.3ms 6.7MB 443ms 0ms perl 5.36.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 2.5ms 0.2ms 5.0MB 0ms 0ms perl 5.36.0
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
wasm 1.rs 80ms 1.1ms 43.5MB 96ms 4ms node 16.17.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 468ms 0.9ms 4.9MB 457ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 498ms 0.2ms 9.6MB 487ms 0ms wasmtime 1.0.1
wasm 1.rs 501ms 0.6ms 18.0MB 487ms 0ms wasmedgec 0.11.0
wasm 1.rs 572ms 2.4ms 48.5MB 590ms 10ms node 16.17.0
wasm 2.rs 678ms 0.5ms 19.1MB 667ms 0ms wasmedgec 0.11.0
wasm 2.rs 678ms 0.6ms 9.7MB 667ms 0ms wasmtime 1.0.1
wasm 2.rs 689ms 1.3ms 4.8MB 677ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 756ms 0.6ms 48.8MB 780ms 3ms node 16.17.0
perl 2.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.36.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 51ms 0.3ms 4.9MB 40ms 0ms wasmer/llvm 2.3.0
wasm 1.rs 57ms 0.4ms 11.0MB 43ms 0ms wasmtime 1.0.1
wasm 1.rs 58ms 0.8ms 18.9MB 50ms 0ms wasmedgec 0.11.0
wasm 2.rs 73ms 0.4ms 4.8MB 60ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 75ms 1.0ms 11.4MB 67ms 0ms wasmtime 1.0.1
wasm 2.rs 76ms 0.1ms 18.7MB 67ms 0ms wasmedgec 0.11.0
wasm 1.rs 149ms 3.1ms 48.3MB 163ms 13ms node 16.17.0
wasm 2.rs 168ms 0.9ms 52.3MB 197ms 3ms node 16.17.0
perl 2.pl 3226ms 23ms 6.3MB 3213ms 0ms perl 5.36.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 4127ms 2.6ms 19.1MB 4113ms 0ms wasmedgec 0.11.0
wasm 7.rs 4198ms 8.5ms 6.5MB 4180ms 0ms wasmer/llvm 2.3.0
wasm 7.rs 4264ms 0.3ms 19.0MB 4250ms 0ms wasmedgec 0.11.0
wasm 2.rs 4302ms 2.2ms 48.7MB 4317ms 10ms node 16.17.0
wasm 2.rs 4399ms 7.8ms 6.0MB 4380ms 0ms wasmer/llvm 2.3.0
wasm 7.rs 4512ms 1.7ms 48.3MB 4537ms 10ms node 16.17.0
wasm 2.rs 4543ms 13ms 11.6MB 4533ms 0ms wasmtime 1.0.1
wasm 7.rs 4610ms 0.1ms 11.1MB 4600ms 0ms wasmtime 1.0.1
perl 4.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.36.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 1039ms 0.9ms 19.1MB 1023ms 3ms wasmedgec 0.11.0
wasm 7.rs 1052ms 0.4ms 6.3MB 1040ms 0ms wasmer/llvm 2.3.0
wasm 7.rs 1074ms 0.2ms 18.4MB 1070ms 0ms wasmedgec 0.11.0
wasm 2.rs 1102ms 1.3ms 5.9MB 1090ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 1142ms 1.3ms 48.5MB 1167ms 3ms node 16.17.0
wasm 2.rs 1147ms 0.5ms 11.1MB 1133ms 0ms wasmtime 1.0.1
wasm 7.rs 1161ms 0.3ms 11.1MB 1147ms 0ms wasmtime 1.0.1
wasm 7.rs 1203ms 1.2ms 48.3MB 1230ms 3ms node 16.17.0
perl 4.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.36.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 7.rs 267ms 0.3ms 4.9MB 257ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 267ms 0.4ms 18.8MB 253ms 0ms wasmedgec 0.11.0
wasm 7.rs 276ms 0.3ms 18.8MB 260ms 0ms wasmedgec 0.11.0
wasm 2.rs 279ms 0.2ms 4.7MB 270ms 0ms wasmer/llvm 2.3.0
wasm 2.rs 293ms 0.7ms 11.4MB 280ms 0ms wasmtime 1.0.1
wasm 7.rs 296ms 0.5ms 9.5MB 287ms 0ms wasmtime 1.0.1
wasm 2.rs 365ms 1.8ms 48.3MB 383ms 7ms node 16.17.0
wasm 7.rs 388ms 5.9ms 48.2MB 400ms 10ms node 16.17.0
perl 4.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.36.0