Wasm VS D benchmarks

Current benchmark data was generated on Tue Apr 01 2025, 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
d 1.d 1784ms 12ms 312.6MB 1750ms 47ms ldc2 1.40.1
wasm 5.rs 1809ms 60ms 33.1MB 1790ms 7ms wasmtime 31.0.0
wasm 3.rs 1854ms 16ms 49.2MB 1827ms 17ms wasmtime 31.0.0
wasm 4.rs 1863ms 11ms 33.2MB 1840ms 10ms wasmtime 31.0.0
d 1.d 2700ms 18ms 314.7MB 2897ms 43ms dmd 2.110.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 163ms 1.3ms 209.9MB 137ms 10ms ldc2 1.40.1
wasm 5.rs 174ms 4.1ms 19.3MB 157ms 0ms wasmtime 31.0.0
wasm 3.rs 180ms 2.4ms 21.1MB 163ms 0ms wasmtime 31.0.0
wasm 4.rs 181ms 4.0ms 19.2MB 163ms 0ms wasmtime 31.0.0
d 1.d 229ms 2.9ms 212.0MB 200ms 20ms dmd 2.110.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 1133ms 6.8ms 19.4MB 1117ms 0ms wasmtime 31.0.0
d 1.d timeout 0.0ms 17.9MB 4967ms 23ms dmd 2.110.0
d 1.d timeout 0.0ms 16.6MB 4967ms 23ms ldc2 1.40.1

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 82ms 1.6ms 17.7MB 70ms 0ms wasmtime 31.0.0
d 1.d 1038ms 4.5ms 12.2MB 1017ms 10ms ldc2 1.40.1
d 1.d 1327ms 17ms 14.5MB 1303ms 17ms dmd 2.110.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 421ms 7.8ms 18.6MB 403ms 3ms wasmtime 31.0.0
d 1.d 2559ms 8.4ms 8.1MB 2547ms 0ms ldc2 1.40.1
d 1.d 2902ms 0.4ms 10.2MB 2890ms 3ms dmd 2.110.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 115ms 2.6ms 18.0MB 103ms 0ms wasmtime 31.0.0
d 1.d 444ms 1.8ms 8.2MB 430ms 0ms ldc2 1.40.1
d 1.d 527ms 0.9ms 10.5MB 520ms 0ms dmd 2.110.0

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-im.d 375ms 6.2ms 3.0MB 1430ms 0ms ldc2 1.40.1
d 2-im.d 1116ms 3.8ms 3.0MB 4320ms 0ms ldc2 1.40.1
d 1-i.d 1484ms 1.3ms 2.9MB 1473ms 0ms ldc2 1.40.1
d 1.d 3117ms 14ms 2.9MB 3110ms 0ms ldc2 1.40.1
d 2-i.d 3237ms 1.8ms 2.9MB 3227ms 0ms ldc2 1.40.1
d 1.d 3562ms 12ms 4.6MB 3550ms 0ms dmd 2.110.0
wasm 1.rs 4154ms 12ms 16.7MB 4137ms 0ms wasmtime 31.0.0
d 1-im.d 4472ms 33ms 4.9MB 17553ms 10ms dmd 2.110.0
d 1-i.d timeout 0.0ms 4.5MB 4990ms 0ms dmd 2.110.0
d 2-i.d timeout 0.0ms 4.5MB 4990ms 0ms dmd 2.110.0
d 2-im.d timeout 0.0ms 4.9MB 19697ms 7ms dmd 2.110.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-im.d 37ms 0.5ms 3.1MB 110ms 0ms ldc2 1.40.1
d 2-im.d 99ms 0.1ms 3.0MB 350ms 0ms ldc2 1.40.1
d 1-i.d 124ms 0.3ms 2.9MB 117ms 0ms ldc2 1.40.1
d 1.d 263ms 2.2ms 2.9MB 253ms 0ms ldc2 1.40.1
d 2-i.d 268ms 0.9ms 2.8MB 260ms 0ms ldc2 1.40.1
d 1.d 299ms 0.4ms 4.6MB 290ms 0ms dmd 2.110.0
wasm 1.rs 353ms 4.0ms 17.2MB 340ms 0ms wasmtime 31.0.0
d 1-im.d 378ms 1.1ms 5.0MB 1437ms 0ms dmd 2.110.0
d 2-im.d 524ms 1.1ms 5.0MB 2000ms 3ms dmd 2.110.0
d 1-i.d 867ms 10ms 4.5MB 853ms 0ms dmd 2.110.0
d 2-i.d 1368ms 16ms 4.6MB 1360ms 0ms dmd 2.110.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 193ms 0.5ms 49.1MB 180ms 3ms ldc2 1.40.1
wasm 1.rs 237ms 2.6ms 17.5MB 223ms 3ms wasmtime 31.0.0
d 1.d 623ms 1.5ms 53.2MB 613ms 0ms dmd 2.110.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 24ms 0.4ms 11.0MB 13ms 0ms ldc2 1.40.1
wasm 1.rs 32ms 0.9ms 17.3MB 20ms 0ms wasmtime 31.0.0
d 1.d 67ms 1.5ms 13.3MB 60ms 0ms dmd 2.110.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 1.7ms 0.2ms 3.0MB 0ms 0ms ldc2 1.40.1
d 1.d 2.3ms 0.2ms 5.0MB 0ms 0ms dmd 2.110.0
wasm 1.rs 7.3ms 1.3ms 17.4MB 0ms 0ms wasmtime 31.0.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 90ms 0.5ms 17.4MB 80ms 0ms wasmtime 31.0.0
d 1.d 130ms 0.9ms 6.1MB 120ms 0ms ldc2 1.40.1
d 1.d 178ms 1.6ms 8.1MB 167ms 0ms dmd 2.110.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 255ms 5.4ms 16.9MB 240ms 0ms wasmtime 31.0.0
d 1.d 376ms 1.9ms 6.1MB 363ms 13ms ldc2 1.40.1
d 1.d 517ms 0.7ms 7.9MB 507ms 20ms dmd 2.110.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 48ms 1.5ms 17.4MB 37ms 0ms wasmtime 31.0.0
d 1.d 57ms 0.9ms 5.9MB 50ms 0ms ldc2 1.40.1
d 1.d 80ms 1.4ms 8.2MB 70ms 0ms dmd 2.110.0

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 295ms 1.3ms 7.0MB 283ms 0ms ldc2 1.40.1
wasm 8.rs 832ms 8.8ms 20.3MB 817ms 0ms wasmtime 31.0.0
d 1.d 2396ms 387ms 8.8MB 2387ms 0ms dmd 2.110.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 15ms 0.1ms 3.0MB 10ms 0ms ldc2 1.40.1
wasm 8.rs 43ms 1.1ms 17.4MB 30ms 0ms wasmtime 31.0.0
d 1.d 97ms 3.2ms 4.6MB 90ms 0ms dmd 2.110.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 939ms 69ms 41.1MB 913ms 13ms wasmtime 31.0.0
d 1.d 987ms 6.0ms 312.7MB 953ms 40ms ldc2 1.40.1
d 1.d 1748ms 11ms 314.7MB 1867ms 50ms dmd 2.110.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 198ms 3.5ms 312.6MB 160ms 27ms ldc2 1.40.1
wasm 1.rs 201ms 2.9ms 23.2MB 183ms 0ms wasmtime 31.0.0
d 1.d 339ms 2.9ms 314.9MB 307ms 27ms dmd 2.110.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 361ms 0.6ms 2.9MB 350ms 0ms ldc2 1.40.1
d 1.d 362ms 1.0ms 2.9MB 350ms 0ms ldc2 1.40.1
wasm 1.rs 413ms 2.3ms 17.1MB 400ms 0ms wasmtime 31.0.0
wasm 2.rs 587ms 3.1ms 17.0MB 573ms 0ms wasmtime 31.0.0
d 1.d 686ms 4.3ms 4.6MB 677ms 0ms dmd 2.110.0
d 2.d 2031ms 8.1ms 4.6MB 2023ms 0ms dmd 2.110.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 39ms 0.3ms 2.9MB 30ms 0ms ldc2 1.40.1
d 1.d 40ms 0.3ms 2.9MB 30ms 0ms ldc2 1.40.1
wasm 1.rs 50ms 1.6ms 17.1MB 37ms 0ms wasmtime 31.0.0
wasm 2.rs 67ms 0.7ms 17.4MB 53ms 0ms wasmtime 31.0.0
d 1.d 71ms 0.7ms 4.6MB 60ms 0ms dmd 2.110.0
d 2.d 207ms 1.6ms 4.6MB 200ms 0ms dmd 2.110.0

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 368ms 4.0ms 77.4MB 353ms 0ms dmd 2.110.0
wasm 2.rs 376ms 5.1ms 22.0MB 360ms 0ms wasmtime 31.0.0
d 1.d 385ms 5.5ms 42.9MB 367ms 3ms ldc2 1.40.1
wasm 1.rs 510ms 12ms 56.1MB 493ms 0ms wasmtime 31.0.0
d 2.d 844ms 3.3ms 49.1MB 830ms 7ms ldc2 1.40.1
d 2.d 1185ms 23ms 48.7MB 1173ms 0ms dmd 2.110.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 61ms 0.8ms 15.0MB 50ms 0ms ldc2 1.40.1
d 1.d 76ms 1.0ms 27.1MB 70ms 0ms dmd 2.110.0
wasm 1.rs 99ms 4.3ms 27.0MB 83ms 0ms wasmtime 31.0.0
wasm 2.rs 100ms 2.4ms 18.4MB 83ms 7ms wasmtime 31.0.0
d 2.d 209ms 0.4ms 17.0MB 197ms 0ms ldc2 1.40.1
d 2.d 292ms 3.7ms 18.9MB 280ms 0ms dmd 2.110.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 2211ms 7.5ms 18.2MB 2197ms 0ms wasmtime 31.0.0
d 1.d 2449ms 25ms 8.1MB 2400ms 413ms ldc2 1.40.1
d 1.d 4318ms 7.0ms 10.1MB 4247ms 483ms dmd 2.110.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 531ms 6.4ms 17.6MB 513ms 0ms wasmtime 31.0.0
d 1.d 588ms 6.2ms 8.0MB 580ms 90ms ldc2 1.40.1
d 1.d 1037ms 9.5ms 10.3MB 1007ms 117ms dmd 2.110.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 3610ms 3.0ms 16.9MB 3597ms 0ms wasmtime 31.0.0
d 1.d 4822ms 90ms 4.0MB 4747ms 393ms ldc2 1.40.1
d 1.d timeout 0.0ms 6.5MB 4963ms 280ms dmd 2.110.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 910ms 1.5ms 16.8MB 897ms 0ms wasmtime 31.0.0
d 1.d 1207ms 13ms 4.0MB 1200ms 77ms ldc2 1.40.1
d 1.d 2080ms 41ms 6.9MB 2047ms 127ms dmd 2.110.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 3596ms 8.1ms 3.8MB 3583ms 0ms ldc2 1.40.1
wasm 2.rs 3602ms 4.5ms 16.9MB 3587ms 0ms wasmtime 31.0.0
d 1.d 3674ms 49ms 6.0MB 3667ms 0ms dmd 2.110.0
wasm 7.rs 4912ms 16ms 16.9MB 4897ms 0ms wasmtime 31.0.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 902ms 2.0ms 3.4MB 890ms 0ms ldc2 1.40.1
wasm 2.rs 910ms 0.9ms 16.7MB 897ms 0ms wasmtime 31.0.0
d 1.d 923ms 9.6ms 7.7MB 910ms 0ms dmd 2.110.0
wasm 7.rs 1240ms 9.5ms 16.9MB 1230ms 0ms wasmtime 31.0.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 229ms 1.5ms 3.1MB 220ms 0ms ldc2 1.40.1
wasm 2.rs 235ms 1.1ms 17.2MB 220ms 0ms wasmtime 31.0.0
d 1.d 236ms 0.3ms 4.9MB 227ms 0ms dmd 2.110.0
wasm 7.rs 321ms 11ms 16.8MB 307ms 0ms wasmtime 31.0.0