Perl VS Wasm benchmarks

Current benchmark data was generated on Wed May 25 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz (Model 85)

* -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 1898ms 17ms 24.9MB 1873ms 7ms wasmedgec 0.9.1
wasm 5.rs 1936ms 34ms 22.0MB 1907ms 13ms wasmer/llvm 2.2.1
wasm 3.rs 2021ms 18ms 38.4MB 1977ms 30ms wasmer/llvm 2.2.1
wasm 4.rs 2088ms 133ms 22.1MB 2067ms 7ms wasmer/llvm 2.2.1
wasm 4.rs 2092ms 26ms 25.0MB 2073ms 0ms wasmedgec 0.9.1
wasm 3.rs 2156ms 149ms 40.9MB 2127ms 17ms wasmedgec 0.9.1
wasm 5.rs 2608ms 151ms 57.6MB 2600ms 17ms node 16.15.0
wasm 3.rs 2647ms 167ms 73.5MB 2627ms 30ms node 16.15.0
wasm 4.rs 2785ms 64ms 57.4MB 2780ms 13ms node 16.15.0
wasm 5.rs 2799ms 19ms 26.1MB 2777ms 7ms wasmtime 0.37.0
wasm 3.rs 2904ms 27ms 42.0MB 2873ms 10ms wasmtime 0.37.0
wasm 4.rs 2950ms 7.6ms 26.0MB 2930ms 3ms wasmtime 0.37.0
perl 1.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.34.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 5.rs 188ms 5.7ms 10.9MB 177ms 0ms wasmedgec 0.9.1
wasm 3.rs 193ms 13ms 10.2MB 167ms 3ms wasmer/llvm 2.2.1
wasm 4.rs 194ms 11ms 8.3MB 173ms 0ms wasmer/llvm 2.2.1
wasm 4.rs 203ms 1.7ms 11.0MB 183ms 0ms wasmedgec 0.9.1
wasm 5.rs 215ms 14ms 8.2MB 193ms 0ms wasmer/llvm 2.2.1
wasm 3.rs 218ms 7.1ms 12.9MB 197ms 3ms wasmedgec 0.9.1
wasm 5.rs 255ms 17ms 12.1MB 240ms 0ms wasmtime 0.37.0
wasm 3.rs 278ms 22ms 14.2MB 250ms 3ms wasmtime 0.37.0
wasm 4.rs 280ms 0.6ms 12.1MB 263ms 0ms wasmtime 0.37.0
wasm 5.rs 300ms 21ms 43.2MB 300ms 10ms node 16.15.0
wasm 4.rs 331ms 4.6ms 43.6MB 343ms 3ms node 16.15.0
wasm 3.rs 355ms 50ms 45.7MB 337ms 10ms node 16.15.0
perl 1.pl 1991ms 5.7ms 14.4MB 1973ms 3ms perl 5.34.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 272ms 0.6ms 10.1MB 253ms 0ms wasmtime 0.37.0
wasm 1.rs 285ms 0.2ms 8.8MB 270ms 0ms wasmedgec 0.9.1
wasm 1.rs 297ms 2.4ms 6.5MB 287ms 0ms wasmer/llvm 2.2.1
wasm 1.rs 408ms 2.6ms 41.9MB 420ms 10ms node 16.15.0
perl 1.pl 3920ms 281ms 10.8MB 3900ms 0ms perl 5.34.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 34ms 0.9ms 9.1MB 20ms 0ms wasmtime 0.37.0
wasm 1.rs 40ms 0.7ms 8.7MB 30ms 0ms wasmedgec 0.9.1
wasm 1.rs 41ms 12ms 6.3MB 27ms 0ms wasmer/llvm 2.2.1
wasm 1.rs 118ms 1.8ms 41.8MB 127ms 10ms node 16.15.0
perl 1.pl 435ms 1.0ms 6.6MB 420ms 0ms perl 5.34.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 4.2ms 1.5ms 5.0MB 0ms 0ms perl 5.34.1
wasm 1.rs 5.8ms 1.2ms 9.0MB 0ms 0ms wasmtime 0.37.0
wasm 1.rs 7.6ms 9.4ms 5.9MB 0ms 0ms wasmer/llvm 2.2.1
wasm 1.rs 10ms 0.6ms 8.5MB 0ms 0ms wasmedgec 0.9.1
wasm 1.rs 76ms 1.6ms 41.6MB 82ms 12ms node 16.15.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 545ms 0.1ms 4.9MB 533ms 0ms wasmer/llvm 2.2.1
wasm 1.rs 558ms 19ms 9.3MB 547ms 0ms wasmtime 0.37.0
wasm 1.rs 609ms 0.4ms 9.2MB 597ms 0ms wasmedgec 0.9.1
wasm 1.rs 644ms 12ms 46.4MB 657ms 10ms node 16.15.0
wasm 2.rs 729ms 68ms 9.6MB 713ms 0ms wasmedgec 0.9.1
wasm 2.rs 780ms 43ms 5.1MB 773ms 0ms wasmer/llvm 2.2.1
wasm 2.rs 824ms 30ms 11.0MB 810ms 0ms wasmtime 0.37.0
wasm 2.rs 891ms 2.3ms 46.4MB 907ms 7ms node 16.15.0
perl 2.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.34.1

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 61ms 11ms 5.9MB 50ms 0ms wasmer/llvm 2.2.1
wasm 1.rs 65ms 1.4ms 9.2MB 53ms 0ms wasmtime 0.37.0
wasm 1.rs 74ms 1.8ms 9.2MB 60ms 0ms wasmedgec 0.9.1
wasm 2.rs 90ms 16ms 5.8MB 67ms 0ms wasmer/llvm 2.2.1
wasm 2.rs 92ms 1.5ms 9.6MB 77ms 0ms wasmedgec 0.9.1
wasm 2.rs 93ms 1.5ms 10.9MB 80ms 0ms wasmtime 0.37.0
wasm 1.rs 157ms 4.8ms 46.4MB 170ms 10ms node 16.15.0
wasm 2.rs 180ms 4.3ms 46.4MB 200ms 7ms node 16.15.0
perl 2.pl 3045ms 197ms 6.3MB 3027ms 0ms perl 5.34.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 3044ms 0.9ms 11.7MB 3027ms 0ms wasmedgec 0.9.1
wasm 7.rs 3226ms 4.2ms 6.2MB 3217ms 0ms wasmer/llvm 2.2.1
wasm 2.rs 3406ms 239ms 10.3MB 3393ms 0ms wasmtime 0.37.0
wasm 7.rs 3414ms 251ms 9.7MB 3400ms 0ms wasmedgec 0.9.1
wasm 2.rs 3680ms 8.8ms 6.3MB 3670ms 0ms wasmer/llvm 2.2.1
wasm 7.rs 3832ms 272ms 46.6MB 3850ms 7ms node 16.15.0
wasm 7.rs 4251ms 297ms 10.3MB 4233ms 0ms wasmtime 0.37.0
wasm 2.rs 4272ms 294ms 46.4MB 4290ms 13ms node 16.15.0
perl 4.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.34.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 772ms 0.5ms 9.6MB 760ms 0ms wasmedgec 0.9.1
wasm 7.rs 825ms 3.5ms 9.6MB 810ms 0ms wasmedgec 0.9.1
wasm 7.rs 884ms 61ms 6.2MB 870ms 0ms wasmer/llvm 2.2.1
wasm 2.rs 895ms 0.4ms 10.3MB 880ms 0ms wasmtime 0.37.0
wasm 2.rs 926ms 0.7ms 6.3MB 910ms 0ms wasmer/llvm 2.2.1
wasm 7.rs 1076ms 70ms 46.4MB 1090ms 3ms node 16.15.0
wasm 7.rs 1114ms 0.8ms 10.3MB 1103ms 0ms wasmtime 0.37.0
wasm 2.rs 1187ms 1.0ms 46.3MB 1210ms 3ms node 16.15.0
perl 4.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.34.1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 214ms 16ms 11.5MB 200ms 0ms wasmedgec 0.9.1
wasm 7.rs 226ms 18ms 11.5MB 210ms 0ms wasmedgec 0.9.1
wasm 2.rs 231ms 1.1ms 9.2MB 217ms 0ms wasmtime 0.37.0
wasm 7.rs 238ms 10ms 5.8MB 220ms 0ms wasmer/llvm 2.2.1
wasm 2.rs 243ms 14ms 5.9MB 223ms 0ms wasmer/llvm 2.2.1
wasm 7.rs 286ms 1.2ms 9.8MB 273ms 0ms wasmtime 0.37.0
wasm 7.rs 323ms 2.1ms 50.3MB 333ms 13ms node 16.15.0
wasm 2.rs 375ms 1.8ms 46.3MB 397ms 7ms node 16.15.0
perl 4-m.pl 4778ms 29ms 9.4MB 8997ms 0ms perl 5.34.1