Wasm VS Dart benchmarks

Current benchmark data was generated on Thu May 04 2023, 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
dart 1.dart 1260ms 24ms 79.6MB 1227ms 40ms dart/exe 3.1.0-63.0.dev
dart 1.dart 1292ms 5.7ms 85.7MB 1250ms 40ms dart/exe 2.19.6
wasm 3.rs 2247ms 10ms 47.7MB 2220ms 13ms wasmedgec 0.12.0
wasm 5.rs 2270ms 20ms 31.4MB 2250ms 7ms wasmedgec 0.12.0
wasm 4.rs 2399ms 17ms 31.1MB 2377ms 7ms wasmedgec 0.12.0
wasm 5.rs 2729ms 16ms 64.3MB 2703ms 13ms node 18.16.0
wasm 5.rs 2794ms 29ms 31.5MB 2767ms 7ms wasmtime 8.0.1
wasm 3.rs 2829ms 27ms 47.5MB 2807ms 10ms wasmtime 8.0.1
wasm 4.rs 2851ms 30ms 64.2MB 2820ms 20ms node 18.16.0
wasm 3.rs 2897ms 22ms 80.3MB 2873ms 23ms node 18.16.0
wasm 4.rs 2989ms 34ms 31.5MB 2963ms 10ms wasmtime 8.0.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 113ms 4.2ms 41.8MB 83ms 17ms dart/exe 3.1.0-63.0.dev
dart 1.dart 118ms 2.2ms 49.6MB 93ms 13ms dart/exe 2.19.6
wasm 3.rs 211ms 4.7ms 19.6MB 193ms 0ms wasmedgec 0.12.0
wasm 5.rs 213ms 2.7ms 17.4MB 197ms 0ms wasmedgec 0.12.0
wasm 4.rs 228ms 2.4ms 17.5MB 210ms 0ms wasmedgec 0.12.0
wasm 5.rs 273ms 5.7ms 17.3MB 260ms 0ms wasmtime 8.0.1
wasm 3.rs 280ms 21ms 19.4MB 247ms 3ms wasmtime 8.0.1
wasm 4.rs 288ms 8.4ms 17.3MB 267ms 0ms wasmtime 8.0.1
wasm 5.rs 302ms 0.8ms 51.2MB 287ms 10ms node 18.16.0
wasm 4.rs 312ms 5.2ms 51.6MB 293ms 17ms node 18.16.0
wasm 3.rs 314ms 2.5ms 51.9MB 300ms 10ms node 18.16.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 1479ms 33ms 57.3MB 1477ms 23ms node 18.16.0
wasm 3.rs 1566ms 54ms 18.1MB 1537ms 0ms wasmtime 8.0.1
wasm 3.rs 2041ms 2.4ms 17.9MB 2023ms 0ms wasmedgec 0.12.0
dart 1.dart timeout 0.0ms 24.2MB 4887ms 83ms dart/exe 2.19.6
dart 1.dart timeout 0.0ms 18.2MB 4920ms 63ms dart/exe 3.1.0-63.0.dev

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 105ms 1.9ms 16.3MB 90ms 0ms wasmtime 8.0.1
wasm 3.rs 139ms 1.4ms 16.1MB 127ms 0ms wasmedgec 0.12.0
wasm 3.rs 188ms 16ms 56.8MB 160ms 23ms node 18.16.0
dart 1.dart 528ms 2.5ms 18.0MB 497ms 17ms dart/exe 2.19.6
dart 1.dart 548ms 5.2ms 9.9MB 517ms 13ms dart/exe 3.1.0-63.0.dev

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 462ms 1.8ms 16.9MB 443ms 0ms wasmedgec 0.12.0
wasm 1.rs 595ms 0.2ms 57.2MB 630ms 7ms node 18.16.0
wasm 1.rs 649ms 22ms 17.0MB 630ms 3ms wasmtime 8.0.1
dart 1.dart timeout 0.0ms 22.8MB 4977ms 17ms dart/exe 2.19.6
dart 1.dart timeout 0.0ms 15.9MB 4977ms 10ms dart/exe 3.1.0-63.0.dev

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 125ms 1.5ms 16.4MB 117ms 0ms wasmedgec 0.12.0
wasm 1.rs 169ms 2.1ms 16.3MB 160ms 0ms wasmtime 8.0.1
wasm 1.rs 222ms 2.0ms 56.7MB 237ms 20ms node 18.16.0
dart 1.dart 1719ms 7.3ms 16.1MB 1687ms 23ms dart/exe 2.19.6
dart 1.dart 1735ms 9.8ms 9.7MB 1707ms 10ms dart/exe 3.1.0-63.0.dev

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 4275ms 2.0ms 11.7MB 4263ms 0ms dart/exe 2.19.6
dart 2.dart 4385ms 5.7ms 5.5MB 4370ms 0ms dart/exe 3.1.0-63.0.dev
wasm 1.rs timeout 0.0ms 49.3MB 4973ms 13ms node 18.16.0
wasm 1.rs timeout 0.0ms 15.4MB 4983ms 0ms wasmedgec 0.12.0
wasm 1.rs timeout 0.0ms 15.6MB 4983ms 0ms wasmtime 8.0.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 355ms 2.5ms 5.5MB 343ms 0ms dart/exe 3.1.0-63.0.dev
dart 2.dart 355ms 12ms 13.7MB 337ms 3ms dart/exe 2.19.6
wasm 1.rs 448ms 9.2ms 15.6MB 430ms 0ms wasmtime 8.0.1
wasm 1.rs 515ms 3.5ms 16.0MB 500ms 0ms wasmedgec 0.12.0
wasm 1.rs 796ms 4.0ms 48.9MB 780ms 10ms node 18.16.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 294ms 0.9ms 15.6MB 277ms 0ms wasmedgec 0.12.0
wasm 1.rs 457ms 0.5ms 49.5MB 440ms 10ms node 18.16.0
wasm 1.rs 466ms 7.4ms 15.4MB 450ms 0ms wasmtime 8.0.1
dart 1.dart 514ms 1.4ms 8.5MB 500ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 532ms 6.5ms 14.2MB 507ms 3ms dart/exe 2.19.6

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 38ms 1.0ms 15.6MB 27ms 0ms wasmedgec 0.12.0
wasm 1.rs 57ms 4.5ms 15.6MB 47ms 0ms wasmtime 8.0.1
dart 1.dart 61ms 0.5ms 8.0MB 47ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 63ms 0.5ms 14.4MB 50ms 0ms dart/exe 2.19.6
wasm 1.rs 94ms 3.1ms 49.2MB 77ms 3ms node 18.16.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 6.0ms 2.5ms 6.2MB 0ms 0ms dart/exe 3.1.0-63.0.dev
wasm 1.rs 6.7ms 0.8ms 15.5MB 0ms 0ms wasmedgec 0.12.0
dart 1.dart 8.1ms 0.9ms 13.7MB 0ms 0ms dart/exe 2.19.6
wasm 1.rs 9.7ms 1.3ms 15.7MB 0ms 0ms wasmtime 8.0.1
wasm 1.rs 50ms 1.9ms 47.3MB 32ms 8ms node 18.16.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 160ms 2.1ms 15.6MB 147ms 0ms wasmedgec 0.12.0
wasm 1.rs 192ms 6.2ms 15.8MB 177ms 0ms wasmtime 8.0.1
dart 2.dart 220ms 4.5ms 8.9MB 207ms 0ms dart/exe 3.1.0-63.0.dev
dart 2.dart 239ms 11ms 17.2MB 223ms 0ms dart/exe 2.19.6
wasm 1.rs 269ms 3.7ms 53.8MB 260ms 7ms node 18.16.0
dart 1.dart 1053ms 4.2ms 8.7MB 1033ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 1068ms 3.5ms 16.8MB 1053ms 0ms dart/exe 2.19.6

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 459ms 1.8ms 15.2MB 440ms 0ms wasmedgec 0.12.0
wasm 1.rs 554ms 14ms 15.7MB 537ms 0ms wasmtime 8.0.1
dart 2.dart 642ms 2.6ms 8.7MB 623ms 3ms dart/exe 3.1.0-63.0.dev
dart 2.dart 678ms 10ms 15.1MB 657ms 3ms dart/exe 2.19.6
wasm 1.rs 690ms 3.5ms 53.3MB 677ms 13ms node 18.16.0
dart 1.dart 3140ms 6.3ms 8.4MB 3123ms 3ms dart/exe 3.1.0-63.0.dev
dart 1.dart 3182ms 6.6ms 14.9MB 3160ms 7ms dart/exe 2.19.6

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 82ms 0.5ms 15.4MB 70ms 0ms wasmedgec 0.12.0
wasm 1.rs 101ms 2.7ms 15.6MB 87ms 0ms wasmtime 8.0.1
dart 2.dart 103ms 1.5ms 8.5MB 90ms 0ms dart/exe 3.1.0-63.0.dev
dart 2.dart 112ms 2.4ms 14.8MB 93ms 0ms dart/exe 2.19.6
wasm 1.rs 157ms 1.4ms 51.3MB 150ms 7ms node 18.16.0
dart 1.dart 177ms 2.8ms 9.2MB 160ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 181ms 2.3ms 17.0MB 167ms 3ms dart/exe 2.19.6

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 8.rs 1069ms 7.8ms 18.5MB 1053ms 0ms wasmedgec 0.12.0
wasm 8.rs 1367ms 4.8ms 18.7MB 1353ms 0ms wasmtime 8.0.1
wasm 8.rs 1560ms 40ms 52.6MB 1547ms 7ms node 18.16.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 8.rs 53ms 0.1ms 15.5MB 40ms 0ms wasmedgec 0.12.0
wasm 8.rs 69ms 3.4ms 15.4MB 53ms 0ms wasmtime 8.0.1
wasm 8.rs 114ms 1.6ms 50.3MB 103ms 3ms node 18.16.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 611ms 6.7ms 62.9MB 587ms 27ms dart/exe 3.1.0-63.0.dev
dart 1.dart 624ms 5.7ms 70.8MB 590ms 27ms dart/exe 2.19.6
wasm 1.rs 1138ms 5.0ms 39.6MB 1117ms 10ms wasmedgec 0.12.0
wasm 1.rs 1361ms 19ms 39.6MB 1330ms 17ms wasmtime 8.0.1
wasm 1.rs 1379ms 6.0ms 73.8MB 1357ms 20ms node 18.16.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 146ms 2.8ms 48.7MB 117ms 13ms dart/exe 2.19.6
dart 1.dart 152ms 3.7ms 43.2MB 113ms 20ms dart/exe 3.1.0-63.0.dev
wasm 1.rs 246ms 0.3ms 21.3MB 230ms 0ms wasmedgec 0.12.0
wasm 1.rs 289ms 3.1ms 21.6MB 270ms 3ms wasmtime 8.0.1
wasm 1.rs 341ms 1.4ms 57.2MB 323ms 7ms node 18.16.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 581ms 0.6ms 17.4MB 567ms 0ms wasmedgec 0.12.0
wasm 1.rs 589ms 12ms 15.5MB 570ms 0ms wasmtime 8.0.1
dart 3.dart 592ms 2.0ms 5.8MB 577ms 0ms dart/exe 3.1.0-63.0.dev
dart 3.dart 612ms 15ms 14.0MB 593ms 0ms dart/exe 2.19.6
wasm 1.rs 779ms 2.9ms 48.9MB 763ms 10ms node 18.16.0
wasm 2.rs 810ms 1.0ms 15.9MB 793ms 0ms wasmedgec 0.12.0
wasm 2.rs 857ms 32ms 15.6MB 840ms 0ms wasmtime 8.0.1
wasm 2.rs 1099ms 9.1ms 50.0MB 1083ms 7ms node 18.16.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 66ms 1.8ms 15.8MB 50ms 0ms wasmedgec 0.12.0
dart 3.dart 69ms 3.5ms 5.9MB 57ms 0ms dart/exe 3.1.0-63.0.dev
wasm 1.rs 70ms 3.0ms 15.6MB 60ms 0ms wasmtime 8.0.1
wasm 2.rs 89ms 1.0ms 15.7MB 80ms 0ms wasmedgec 0.12.0
wasm 2.rs 102ms 8.0ms 15.6MB 87ms 0ms wasmtime 8.0.1
wasm 1.rs 131ms 6.2ms 47.7MB 113ms 10ms node 18.16.0
wasm 2.rs 159ms 3.3ms 50.1MB 137ms 13ms node 18.16.0
dart 3.dart 1073ms 2.3ms 13.5MB 60ms 0ms dart/exe 2.19.6

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 583ms 2.3ms 20.4MB 570ms 0ms wasmedgec 0.12.0
wasm 2.rs 820ms 0.7ms 20.5MB 807ms 0ms wasmtime 8.0.1
wasm 1.rs 1189ms 31ms 54.6MB 1160ms 13ms wasmedgec 0.12.0
wasm 2.rs 1312ms 3.0ms 53.5MB 1297ms 3ms node 18.16.0
wasm 1.rs 2056ms 38ms 54.7MB 2037ms 10ms wasmtime 8.0.1
wasm 1.rs 2179ms 47ms 88.3MB 2147ms 27ms node 18.16.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 135ms 1.5ms 18.6MB 120ms 0ms wasmedgec 0.12.0
wasm 1.rs 152ms 1.4ms 25.4MB 140ms 0ms wasmedgec 0.12.0
wasm 1.rs 203ms 7.7ms 25.5MB 183ms 0ms wasmtime 8.0.1
wasm 2.rs 210ms 9.7ms 16.7MB 197ms 0ms wasmtime 8.0.1
wasm 2.rs 352ms 3.1ms 50.4MB 337ms 0ms node 18.16.0
wasm 1.rs 372ms 3.4ms 58.4MB 347ms 13ms node 18.16.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 1714ms 20ms 14.7MB 1653ms 53ms dart/exe 3.1.0-63.0.dev
dart 2.dart 1776ms 7.4ms 20.7MB 1720ms 40ms dart/exe 2.19.6
wasm 2.rs 2446ms 4.6ms 16.4MB 2430ms 0ms wasmedgec 0.12.0
wasm 2.rs 2981ms 0.3ms 54.0MB 2987ms 10ms node 18.16.0
wasm 2.rs 3340ms 0.9ms 16.7MB 3323ms 0ms wasmtime 8.0.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 428ms 5.0ms 14.2MB 387ms 20ms dart/exe 3.1.0-63.0.dev
dart 2.dart 445ms 5.5ms 20.2MB 403ms 17ms dart/exe 2.19.6
wasm 2.rs 584ms 5.6ms 16.3MB 573ms 0ms wasmedgec 0.12.0
wasm 2.rs 755ms 3.9ms 54.2MB 760ms 10ms node 18.16.0
wasm 2.rs 790ms 1.4ms 16.3MB 773ms 0ms wasmtime 8.0.1

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 4154ms 3.8ms 15.7MB 4140ms 0ms wasmedgec 0.12.0
wasm 1.rs 4399ms 20ms 59.5MB 4443ms 13ms node 18.16.0
wasm 1.rs 4925ms 25ms 15.7MB 4907ms 0ms wasmtime 8.0.1

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 1045ms 1.8ms 15.9MB 1027ms 0ms wasmedgec 0.12.0
wasm 1.rs 1166ms 7.7ms 61.2MB 1203ms 17ms node 18.16.0
wasm 1.rs 1238ms 5.4ms 15.6MB 1220ms 3ms wasmtime 8.0.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 3441ms 0.7ms 16.1MB 3420ms 0ms wasmedgec 0.12.0
wasm 7.rs 3667ms 21ms 16.2MB 3650ms 0ms wasmedgec 0.12.0
wasm 2.rs 3814ms 3.2ms 15.5MB 3797ms 0ms wasmtime 8.0.1
wasm 7.rs 4365ms 35ms 48.9MB 4347ms 7ms node 18.16.0
wasm 2.rs 4483ms 1.7ms 48.8MB 4463ms 7ms node 18.16.0
dart 1.dart 4795ms 3.3ms 5.8MB 4783ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart timeout 0.0ms 11.6MB 4987ms 0ms dart/exe 2.19.6
wasm 7.rs timeout 0.0ms 15.6MB 4980ms 0ms wasmtime 8.0.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 868ms 0.6ms 16.1MB 850ms 0ms wasmedgec 0.12.0
wasm 7.rs 918ms 0.3ms 16.0MB 903ms 0ms wasmedgec 0.12.0
wasm 2.rs 1018ms 0.2ms 15.6MB 1000ms 0ms wasmtime 8.0.1
wasm 7.rs 1138ms 2.2ms 48.9MB 1123ms 7ms node 18.16.0
wasm 2.rs 1158ms 0.9ms 48.5MB 1140ms 7ms node 18.16.0
dart 1.dart 1208ms 2.7ms 5.7MB 1193ms 0ms dart/exe 3.1.0-63.0.dev
dart 1.dart 1405ms 1.9ms 11.9MB 1390ms 0ms dart/exe 2.19.6
wasm 7.rs 3224ms 1.1ms 15.6MB 3213ms 0ms wasmtime 8.0.1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 224ms 0.8ms 15.8MB 213ms 0ms wasmedgec 0.12.0
wasm 7.rs 239ms 4.3ms 15.8MB 220ms 0ms wasmedgec 0.12.0
wasm 2.rs 263ms 1.6ms 15.5MB 247ms 0ms wasmtime 8.0.1
dart 1.dart 308ms 1.8ms 5.8MB 293ms 0ms dart/exe 3.1.0-63.0.dev
wasm 7.rs 323ms 2.1ms 47.7MB 307ms 3ms node 18.16.0
wasm 2.rs 329ms 0.3ms 48.6MB 310ms 3ms node 18.16.0
dart 1.dart 361ms 2.1ms 13.8MB 343ms 0ms dart/exe 2.19.6
wasm 7.rs 816ms 3.0ms 15.6MB 800ms 0ms wasmtime 8.0.1