Perl VS Wasm benchmarks

Current benchmark data was generated on Mon Dec 30 2024, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1)

* -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 1721ms 55ms 34.9MB 1707ms 0ms wasmtime 28.0.0
wasm 3.rs 1751ms 19ms 52.9MB 1727ms 13ms wasmtime 28.0.0
wasm 4.rs 1758ms 1.3ms 34.9MB 1733ms 10ms wasmtime 28.0.0
perl 1.pl timeout 0.0ms 77.8MB 4970ms 13ms perl 5.40.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 169ms 2.4ms 22.9MB 153ms 3ms wasmtime 28.0.0
wasm 5.rs 170ms 5.5ms 21.0MB 157ms 3ms wasmtime 28.0.0
wasm 4.rs 172ms 2.6ms 21.2MB 157ms 0ms wasmtime 28.0.0
perl 1.pl 1811ms 29ms 14.3MB 1793ms 3ms perl 5.40.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 234ms 1.6ms 19.0MB 220ms 0ms wasmtime 28.0.0
perl 1.pl 3601ms 9.2ms 10.9MB 3590ms 0ms perl 5.40.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 31ms 0.9ms 19.0MB 23ms 0ms wasmtime 28.0.0
perl 1.pl 376ms 1.7ms 6.8MB 360ms 0ms perl 5.40.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 2.7ms 0.4ms 5.1MB 0ms 0ms perl 5.40.0
wasm 1.rs 6.6ms 0.3ms 19.5MB 0ms 0ms wasmtime 28.0.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 399ms 1.0ms 20.8MB 387ms 0ms wasmtime 28.0.0
wasm 2.rs 576ms 0.3ms 18.8MB 563ms 0ms wasmtime 28.0.0
perl 2.pl timeout 0.0ms 6.1MB 4990ms 0ms perl 5.40.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 47ms 0.6ms 19.0MB 40ms 0ms wasmtime 28.0.0
wasm 2.rs 66ms 0.7ms 18.8MB 57ms 0ms wasmtime 28.0.0
perl 2.pl 2734ms 15ms 6.1MB 2720ms 0ms perl 5.40.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 3583ms 2.7ms 20.7MB 3567ms 0ms wasmtime 28.0.0
wasm 7.rs 4871ms 7.3ms 19.1MB 4857ms 0ms wasmtime 28.0.0
perl 4.pl timeout 0.0ms 13.9MB 19760ms 20ms perl 5.40.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 904ms 2.6ms 18.6MB 890ms 0ms wasmtime 28.0.0
wasm 7.rs 1229ms 3.0ms 20.6MB 1210ms 0ms wasmtime 28.0.0
perl 4.pl timeout 0.0ms 13.1MB 19567ms 13ms perl 5.40.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 233ms 1.6ms 20.5MB 223ms 3ms wasmtime 28.0.0
wasm 7.rs 314ms 2.7ms 20.5MB 300ms 0ms wasmtime 28.0.0
perl 4-m.pl 3442ms 70ms 13.6MB 13187ms 3ms perl 5.40.0