Typescript VS Wasm benchmarks

Current benchmark data was generated on Thu May 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
typescript 1.ts 1067ms 12ms 466.8MB 997ms 217ms deno 2.3.1
wasm 5.rs 1774ms 4.7ms 33.7MB 1757ms 7ms wasmtime 32.0.0
wasm 3.rs 1818ms 20ms 49.7MB 1790ms 13ms wasmtime 32.0.0
wasm 4.rs 1821ms 4.3ms 33.8MB 1803ms 7ms wasmtime 32.0.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 129ms 2.3ms 78.9MB 127ms 27ms deno 2.3.1
wasm 5.rs 170ms 2.0ms 19.7MB 160ms 0ms wasmtime 32.0.0
wasm 4.rs 177ms 2.1ms 19.7MB 163ms 0ms wasmtime 32.0.0
wasm 3.rs 180ms 5.3ms 21.7MB 163ms 0ms wasmtime 32.0.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 1138ms 15ms 20.2MB 1123ms 0ms wasmtime 32.0.0
typescript 1.ts 1280ms 29ms 118.4MB 1270ms 60ms deno 2.3.1

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 3.rs 82ms 1.1ms 20.2MB 70ms 0ms wasmtime 32.0.0
typescript 1.ts 145ms 1.9ms 69.3MB 123ms 23ms deno 2.3.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 236ms 2.0ms 17.9MB 223ms 0ms wasmtime 32.0.0
typescript 1.ts 2066ms 6.2ms 56.5MB 1920ms 150ms deno 2.3.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 31ms 1.2ms 17.8MB 20ms 0ms wasmtime 32.0.0
typescript 1.ts 242ms 1.8ms 55.8MB 220ms 23ms deno 2.3.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 6.4ms 0.3ms 16.1MB 0ms 0ms wasmtime 32.0.0
typescript 1.ts 26ms 0.2ms 44.4MB 10ms 6ms deno 2.3.1

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 2-m.ts 657ms 9.2ms 237.2MB 603ms 437ms deno 2.3.1
typescript 1-m.ts 659ms 9.6ms 238.0MB 613ms 433ms deno 2.3.1
typescript 1-http2.ts 808ms 1.8ms 228.0MB 747ms 420ms deno 2.3.1
typescript 2-tls.ts 1391ms 24ms 262.6MB 1270ms 497ms deno 2.3.1

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 167ms 1.9ms 92.1MB 127ms 90ms deno 2.3.1
typescript 2.ts 167ms 2.8ms 92.6MB 127ms 90ms deno 2.3.1
typescript 1-http2.ts 204ms 1.0ms 94.6MB 153ms 97ms deno 2.3.1
typescript 2-tls.ts 347ms 8.0ms 97.7MB 267ms 123ms deno 2.3.1

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 163ms 3.6ms 91.8MB 160ms 30ms deno 2.3.1

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 1181ms 2.5ms 415.6MB 1300ms 143ms deno 2.3.1

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 87ms 2.0ms 17.8MB 77ms 0ms wasmtime 32.0.0
typescript 2.ts 274ms 4.0ms 62.8MB 263ms 13ms deno 2.3.1
typescript 1.ts 575ms 2.8ms 59.6MB 557ms 10ms deno 2.3.1

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 246ms 2.8ms 17.5MB 233ms 0ms wasmtime 32.0.0
typescript 2.ts 735ms 2.5ms 68.5MB 720ms 20ms deno 2.3.1
typescript 1.ts 1646ms 1.7ms 67.9MB 1620ms 17ms deno 2.3.1

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 46ms 0.8ms 17.7MB 33ms 0ms wasmtime 32.0.0
typescript 2.ts 142ms 1.0ms 56.8MB 130ms 13ms deno 2.3.1
typescript 1.ts 168ms 2.6ms 57.0MB 150ms 10ms deno 2.3.1

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 560ms 9.4ms 227.2MB 560ms 110ms deno 2.3.1
wasm 1.rs 885ms 0.7ms 43.7MB 860ms 10ms wasmtime 32.0.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 153ms 3.6ms 96.0MB 150ms 37ms deno 2.3.1
wasm 1.rs 197ms 2.7ms 23.7MB 183ms 0ms wasmtime 32.0.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 404ms 2.4ms 17.8MB 393ms 0ms wasmtime 32.0.0
typescript 6.ts 469ms 5.6ms 55.9MB 453ms 3ms deno 2.3.1
wasm 2.rs 563ms 3.0ms 17.9MB 550ms 0ms wasmtime 32.0.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 1.rs 48ms 1.3ms 19.8MB 40ms 0ms wasmtime 32.0.0
wasm 2.rs 63ms 0.2ms 17.9MB 50ms 0ms wasmtime 32.0.0
typescript 6.ts 77ms 0.2ms 54.1MB 63ms 10ms deno 2.3.1

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 2190ms 4.4ms 19.1MB 2173ms 0ms wasmtime 32.0.0
typescript 3.ts 4922ms 34ms 131.3MB 4817ms 147ms deno 2.3.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 519ms 3.4ms 18.1MB 507ms 0ms wasmtime 32.0.0
typescript 3.ts 1128ms 5.5ms 78.3MB 1070ms 80ms deno 2.3.1

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 1941ms 13ms 56.9MB 1947ms 10ms deno 2.3.1
wasm 1.rs 3581ms 22ms 17.6MB 3567ms 0ms wasmtime 32.0.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 536ms 7.3ms 55.8MB 540ms 10ms deno 2.3.1
wasm 1.rs 907ms 5.9ms 17.6MB 897ms 0ms wasmtime 32.0.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 3694ms 3.7ms 17.6MB 3683ms 0ms wasmtime 32.0.0
typescript 7.ts 4058ms 51ms 53.9MB 4040ms 10ms deno 2.3.1
wasm 7.rs 4898ms 2.5ms 18.1MB 4883ms 0ms wasmtime 32.0.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 934ms 2.7ms 17.7MB 920ms 0ms wasmtime 32.0.0
typescript 7.ts 1036ms 5.5ms 56.1MB 1023ms 10ms deno 2.3.1
wasm 7.rs 1229ms 0.8ms 19.5MB 1217ms 0ms wasmtime 32.0.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
wasm 2.rs 239ms 1.7ms 17.4MB 223ms 0ms wasmtime 32.0.0
typescript 7.ts 283ms 1.6ms 52.5MB 267ms 7ms deno 2.3.1
wasm 7.rs 315ms 1.9ms 18.2MB 300ms 0ms wasmtime 32.0.0