Wasm VS D benchmarks

Current benchmark data was generated on Mon May 19 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 1782ms 3.3ms 312.5MB 1753ms 37ms ldc2 1.40.1
wasm 4.rs 1799ms 13ms 33.8MB 1780ms 10ms wasmtime 32.0.0
wasm 5.rs 1807ms 26ms 33.8MB 1787ms 3ms wasmtime 32.0.0
wasm 3.rs 1837ms 50ms 49.8MB 1807ms 17ms wasmtime 32.0.0
d 1.d 3057ms 15ms 314.4MB 3227ms 60ms dmd 2.111.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 167ms 2.7ms 207.7MB 140ms 13ms ldc2 1.40.1
wasm 5.rs 170ms 0.4ms 19.8MB 157ms 0ms wasmtime 32.0.0
wasm 3.rs 172ms 3.8ms 21.7MB 160ms 0ms wasmtime 32.0.0
wasm 4.rs 172ms 1.7ms 19.7MB 160ms 0ms wasmtime 32.0.0
d 1.d 262ms 1.0ms 210.5MB 233ms 17ms dmd 2.111.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 1141ms 15ms 20.2MB 1127ms 0ms wasmtime 32.0.0
d 1.d timeout 0.0ms 18.2MB 4963ms 20ms dmd 2.111.0
d 1.d timeout 0.0ms 17.6MB 4963ms 23ms ldc2 1.40.1

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 83ms 1.7ms 18.3MB 70ms 0ms wasmtime 32.0.0
d 1.d 1046ms 5.9ms 10.5MB 1017ms 13ms ldc2 1.40.1
d 1.d 1385ms 4.2ms 12.0MB 1360ms 13ms dmd 2.111.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 420ms 2.0ms 19.4MB 407ms 0ms wasmtime 32.0.0
d 1.d 2552ms 4.9ms 8.2MB 2540ms 0ms ldc2 1.40.1
d 1.d 2864ms 4.6ms 10.4MB 2853ms 0ms dmd 2.111.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 114ms 1.7ms 19.0MB 100ms 0ms wasmtime 32.0.0
d 1.d 443ms 3.5ms 8.0MB 433ms 0ms ldc2 1.40.1
d 1.d 518ms 2.7ms 10.5MB 507ms 0ms dmd 2.111.0

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-im.d 387ms 21ms 3.0MB 1427ms 0ms ldc2 1.40.1
d 2-im.d 1132ms 37ms 3.0MB 4310ms 0ms ldc2 1.40.1
d 1-i.d 1484ms 1.2ms 2.8MB 1477ms 0ms ldc2 1.40.1
d 1.d 3132ms 33ms 2.9MB 3123ms 0ms ldc2 1.40.1
d 2-i.d 3237ms 4.9ms 2.9MB 3227ms 0ms ldc2 1.40.1
d 1.d 3534ms 7.1ms 4.6MB 3523ms 0ms dmd 2.111.0
wasm 1.rs 4187ms 38ms 17.3MB 4177ms 0ms wasmtime 32.0.0
d 1-im.d 4468ms 16ms 4.8MB 17560ms 0ms dmd 2.111.0
d 1-i.d timeout 0.0ms 4.6MB 4990ms 0ms dmd 2.111.0
d 2-i.d timeout 0.0ms 4.6MB 4990ms 0ms dmd 2.111.0
d 2-im.d timeout 0.0ms 4.9MB 19707ms 17ms dmd 2.111.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-im.d 37ms 0.6ms 3.0MB 110ms 0ms ldc2 1.40.1
d 2-im.d 98ms 2.5ms 3.0MB 350ms 0ms ldc2 1.40.1
d 1-i.d 124ms 0.6ms 2.9MB 120ms 0ms ldc2 1.40.1
d 1.d 262ms 2.0ms 2.9MB 250ms 0ms ldc2 1.40.1
d 2-i.d 268ms 1.7ms 2.9MB 260ms 0ms ldc2 1.40.1
d 1.d 295ms 1.4ms 4.6MB 287ms 0ms dmd 2.111.0
wasm 1.rs 350ms 1.9ms 19.2MB 340ms 0ms wasmtime 32.0.0
d 1-im.d 378ms 2.8ms 4.9MB 1427ms 0ms dmd 2.111.0
d 2-im.d 531ms 3.0ms 4.9MB 2003ms 0ms dmd 2.111.0
d 1-i.d 902ms 8.7ms 4.6MB 893ms 0ms dmd 2.111.0
d 2-i.d 1382ms 5.8ms 4.5MB 1373ms 0ms dmd 2.111.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 154ms 1.7ms 2.9MB 143ms 0ms ldc2 1.40.1
wasm 1.rs 234ms 2.0ms 17.9MB 220ms 0ms wasmtime 32.0.0
d 1.d 643ms 4.3ms 4.8MB 630ms 0ms dmd 2.111.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 19ms 1.1ms 2.9MB 10ms 0ms ldc2 1.40.1
wasm 1.rs 31ms 0.9ms 17.8MB 20ms 0ms wasmtime 32.0.0
d 1.d 67ms 0.4ms 4.6MB 60ms 0ms dmd 2.111.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 1.7ms 0.1ms 2.9MB 0ms 0ms ldc2 1.40.1
d 1.d 1.9ms 0.1ms 5.1MB 0ms 0ms dmd 2.111.0
wasm 1.rs 6.8ms 0.2ms 18.0MB 0ms 0ms wasmtime 32.0.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 89ms 0.7ms 17.5MB 77ms 0ms wasmtime 32.0.0
d 1.d 131ms 0.7ms 6.2MB 120ms 0ms ldc2 1.40.1
d 1.d 176ms 0.9ms 8.0MB 167ms 3ms dmd 2.111.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 252ms 2.7ms 19.4MB 240ms 0ms wasmtime 32.0.0
d 1.d 377ms 0.9ms 5.9MB 367ms 13ms ldc2 1.40.1
d 1.d 516ms 1.8ms 8.1MB 510ms 10ms dmd 2.111.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 47ms 0.6ms 17.9MB 33ms 0ms wasmtime 32.0.0
d 1.d 56ms 0.4ms 6.1MB 47ms 0ms ldc2 1.40.1
d 1.d 79ms 1.8ms 7.9MB 70ms 0ms dmd 2.111.0

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 295ms 0.5ms 7.4MB 283ms 0ms ldc2 1.40.1
wasm 8.rs 819ms 2.4ms 20.8MB 803ms 0ms wasmtime 32.0.0
d 1.d 2153ms 61ms 9.4MB 2143ms 0ms dmd 2.111.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 15ms 0.6ms 3.0MB 10ms 0ms ldc2 1.40.1
wasm 8.rs 43ms 0.2ms 17.9MB 30ms 0ms wasmtime 32.0.0
d 1.d 92ms 3.0ms 5.0MB 83ms 0ms dmd 2.111.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 901ms 10ms 43.7MB 873ms 10ms wasmtime 32.0.0
d 1.d 968ms 7.6ms 312.4MB 933ms 40ms ldc2 1.40.1
d 1.d 1870ms 35ms 314.3MB 2007ms 47ms dmd 2.111.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 197ms 2.6ms 23.7MB 180ms 0ms wasmtime 32.0.0
d 1.d 199ms 1.4ms 312.5MB 160ms 30ms ldc2 1.40.1
d 1.d 360ms 4.0ms 314.8MB 323ms 33ms dmd 2.111.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 360ms 0.1ms 2.9MB 350ms 0ms ldc2 1.40.1
d 1.d 360ms 0.6ms 2.9MB 350ms 0ms ldc2 1.40.1
wasm 1.rs 407ms 0.1ms 18.2MB 393ms 0ms wasmtime 32.0.0
wasm 2.rs 563ms 1.8ms 17.8MB 550ms 0ms wasmtime 32.0.0
d 1.d 680ms 2.4ms 4.8MB 670ms 0ms dmd 2.111.0
d 2.d 2035ms 5.7ms 4.6MB 2023ms 0ms dmd 2.111.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 38ms 0.1ms 2.9MB 30ms 0ms ldc2 1.40.1
d 2.d 39ms 0.6ms 2.9MB 30ms 0ms ldc2 1.40.1
wasm 1.rs 49ms 0.9ms 18.0MB 40ms 0ms wasmtime 32.0.0
wasm 2.rs 65ms 1.2ms 18.1MB 53ms 0ms wasmtime 32.0.0
d 1.d 72ms 1.0ms 4.8MB 60ms 0ms dmd 2.111.0
d 2.d 208ms 2.5ms 4.8MB 197ms 0ms dmd 2.111.0

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 321ms 12ms 45.7MB 303ms 3ms ldc2 1.40.1
d 1.d 359ms 12ms 79.2MB 347ms 0ms dmd 2.111.0
wasm 2.rs 368ms 9.3ms 22.8MB 357ms 0ms wasmtime 32.0.0
wasm 1.rs 476ms 1.3ms 56.7MB 460ms 0ms wasmtime 32.0.0
d 2.d 849ms 1.3ms 47.5MB 830ms 10ms ldc2 1.40.1
d 2.d 1178ms 13ms 51.8MB 1160ms 10ms dmd 2.111.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 62ms 2.0ms 15.7MB 50ms 0ms ldc2 1.40.1
d 1.d 75ms 1.6ms 25.5MB 63ms 0ms dmd 2.111.0
wasm 1.rs 96ms 3.0ms 27.5MB 83ms 0ms wasmtime 32.0.0
wasm 2.rs 97ms 2.1ms 18.9MB 83ms 0ms wasmtime 32.0.0
d 2.d 210ms 2.6ms 17.6MB 197ms 0ms ldc2 1.40.1
d 2.d 292ms 1.6ms 19.6MB 277ms 0ms dmd 2.111.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 2153ms 20ms 19.1MB 2140ms 0ms wasmtime 32.0.0
d 1.d 2430ms 7.2ms 8.0MB 2377ms 430ms ldc2 1.40.1
d 1.d 4442ms 23ms 10.4MB 4377ms 490ms dmd 2.111.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 504ms 1.2ms 18.1MB 490ms 0ms wasmtime 32.0.0
d 1.d 583ms 1.1ms 8.0MB 567ms 103ms ldc2 1.40.1
d 1.d 1061ms 8.7ms 10.4MB 1033ms 120ms dmd 2.111.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 3424ms 13ms 17.6MB 3410ms 0ms wasmtime 32.0.0
d 1.d 4791ms 12ms 4.0MB 4737ms 387ms ldc2 1.40.1
d 1.d timeout 0.0ms 6.5MB 4933ms 317ms dmd 2.111.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 862ms 4.0ms 17.6MB 850ms 0ms wasmtime 32.0.0
d 1.d 1205ms 8.8ms 3.9MB 1180ms 97ms ldc2 1.40.1
d 1.d 2046ms 8.3ms 6.5MB 2033ms 103ms dmd 2.111.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 3596ms 3.2ms 3.9MB 3583ms 0ms ldc2 1.40.1
d 1.d 3660ms 2.7ms 6.0MB 3650ms 0ms dmd 2.111.0
wasm 2.rs 3700ms 13ms 17.7MB 3687ms 0ms wasmtime 32.0.0
wasm 7.rs 4896ms 4.6ms 17.6MB 4883ms 0ms wasmtime 32.0.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 902ms 2.2ms 3.5MB 890ms 0ms ldc2 1.40.1
d 1.d 926ms 1.0ms 7.9MB 917ms 0ms dmd 2.111.0
wasm 2.rs 932ms 4.9ms 17.6MB 920ms 0ms wasmtime 32.0.0
wasm 7.rs 1230ms 0.5ms 18.1MB 1220ms 0ms wasmtime 32.0.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 228ms 0.6ms 3.1MB 220ms 0ms ldc2 1.40.1
d 1.d 234ms 1.2ms 4.9MB 223ms 0ms dmd 2.111.0
wasm 2.rs 238ms 0.5ms 18.2MB 227ms 0ms wasmtime 32.0.0
wasm 7.rs 314ms 0.7ms 17.9MB 300ms 0ms wasmtime 32.0.0