D VS Typescript benchmarks

Current benchmark data was generated on Mon Feb 06 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
d 1.d 3392ms 64ms 74.9MB 3630ms 33ms ldc2 1.30.0
typescript 1.ts 4002ms 113ms 127.2MB 4077ms 633ms deno 1.30.2
d 1.d 4652ms 28ms 154.1MB 5177ms 33ms dmd 2.102.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 196ms 4.2ms 56.7MB 223ms 13ms deno 1.30.2
d 1.d 306ms 5.6ms 15.1MB 287ms 7ms ldc2 1.30.0
d 1.d 394ms 1.4ms 27.1MB 410ms 0ms dmd 2.102.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 2022ms 10ms 70.1MB 2033ms 33ms deno 1.30.2
d 1.d timeout 0.0ms 14.4MB 4963ms 17ms dmd 2.102.0
d 1.d timeout 0.0ms 13.4MB 4963ms 17ms ldc2 1.30.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 168ms 1.0ms 45.3MB 157ms 3ms deno 1.30.2
d 1.d 1272ms 6.8ms 8.4MB 1247ms 10ms ldc2 1.30.0
d 1.d 1655ms 8.1ms 10.0MB 1640ms 3ms dmd 2.102.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d timeout 0.0ms 9.4MB 4980ms 0ms dmd 2.102.0
d 1.d timeout 0.0ms 7.6MB 4980ms 0ms ldc2 1.30.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 919ms 0.8ms 7.3MB 910ms 0ms ldc2 1.30.0
d 1.d 1055ms 0.3ms 8.7MB 1050ms 0ms dmd 2.102.0

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-im.d 670ms 7.6ms 1.6MB 1260ms 0ms ldc2 1.30.0
d 1-i.d 1256ms 8.5ms 1.5MB 1240ms 0ms ldc2 1.30.0
d 2-im.d 2556ms 2.4ms 1.6MB 4943ms 0ms ldc2 1.30.0
d 1.d 4106ms 20ms 1.5MB 4097ms 0ms ldc2 1.30.0
d 1.d 4235ms 1.1ms 2.7MB 4220ms 0ms dmd 2.102.0
d 2-i.d 4884ms 4.9ms 1.5MB 4870ms 0ms ldc2 1.30.0
d 1-i.d timeout 0.0ms 2.1MB 4987ms 0ms dmd 2.102.0
d 1-im.d timeout 0.0ms 2.7MB 9817ms 0ms dmd 2.102.0
d 2-i.d timeout 0.0ms 2.7MB 4987ms 0ms dmd 2.102.0
d 2-im.d timeout 0.0ms 2.6MB 9470ms 0ms dmd 2.102.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-im.d 66ms 1.8ms 3.1MB 100ms 0ms ldc2 1.30.0
d 1-i.d 108ms 1.1ms 1.5MB 100ms 0ms ldc2 1.30.0
d 2-im.d 221ms 6.2ms 1.5MB 397ms 0ms ldc2 1.30.0
d 1.d 327ms 3.7ms 1.5MB 313ms 0ms ldc2 1.30.0
d 1.d 353ms 0.8ms 2.7MB 340ms 0ms dmd 2.102.0
d 2-i.d 403ms 0.4ms 1.6MB 390ms 0ms ldc2 1.30.0
d 1-im.d 461ms 3.1ms 2.6MB 860ms 0ms dmd 2.102.0
d 2-im.d 760ms 2.3ms 2.6MB 1440ms 0ms dmd 2.102.0
d 1-i.d 863ms 4.3ms 2.2MB 850ms 0ms dmd 2.102.0
d 2-i.d 1378ms 2.0ms 2.6MB 1367ms 0ms dmd 2.102.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 216ms 0.6ms 30.7MB 190ms 10ms ldc2 1.30.0
d 1.d 678ms 0.8ms 39.9MB 657ms 7ms dmd 2.102.0
typescript 1.ts 2140ms 80ms 38.4MB 2007ms 113ms deno 1.30.2

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 26ms 0.9ms 8.9MB 17ms 0ms ldc2 1.30.0
d 1.d 71ms 0.2ms 10.6MB 60ms 0ms dmd 2.102.0
typescript 1.ts 272ms 14ms 38.7MB 220ms 17ms deno 1.30.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 2.2ms 0.3ms 4.4MB 0ms 0ms dmd 2.102.0
d 1.d 2.7ms 0.8ms 2.8MB 0ms 0ms ldc2 1.30.0
typescript 1.ts 25ms 0.6ms 32.7MB 10ms 0ms deno 1.30.2

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 75ms 3.1ms 15.5MB 67ms 3ms ldc2 1.30.0
d 2.d 291ms 1.1ms 21.5MB 277ms 7ms dmd 2.102.0
typescript 1.ts 391ms 5.6ms 89.7MB 380ms 40ms deno 1.30.2

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 608ms 2.1ms 139.8MB 543ms 43ms ldc2 1.30.0
d 2.d 3142ms 1.9ms 157.1MB 3140ms 50ms dmd 2.102.0
typescript 1.ts 3684ms 93ms 384.6MB 3757ms 173ms deno 1.30.2

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-m.d 1552ms 47ms 51.1MB 2807ms 13ms ldc2 1.30.0
d 1-m.d 3770ms 69ms 52.6MB 7183ms 13ms dmd 2.102.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-m.d 188ms 15ms 40.1MB 313ms 7ms ldc2 1.30.0
d 1-m.d 420ms 13ms 42.2MB 747ms 13ms dmd 2.102.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 174ms 0.7ms 3.7MB 167ms 0ms ldc2 1.30.0
d 1.d 249ms 1.3ms 5.3MB 240ms 0ms dmd 2.102.0
typescript 2.ts 380ms 1.8ms 43.6MB 377ms 3ms deno 1.30.2
typescript 1.ts 705ms 0.8ms 44.0MB 693ms 7ms deno 1.30.2

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 509ms 1.6ms 3.7MB 497ms 0ms ldc2 1.30.0
d 1.d 743ms 15ms 5.4MB 733ms 0ms dmd 2.102.0
typescript 2.ts 1057ms 4.3ms 45.6MB 1047ms 7ms deno 1.30.2
typescript 1.ts 2045ms 2.9ms 45.0MB 2033ms 3ms deno 1.30.2

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 75ms 0.9ms 3.7MB 70ms 0ms ldc2 1.30.0
d 1.d 110ms 0.8ms 5.1MB 100ms 0ms dmd 2.102.0
typescript 2.ts 198ms 5.8ms 40.5MB 180ms 10ms deno 1.30.2
typescript 1.ts 224ms 2.5ms 38.2MB 213ms 7ms deno 1.30.2

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 608ms 2.6ms 7.1MB 593ms 0ms ldc2 1.30.0
d 1.d 2901ms 193ms 7.9MB 2887ms 0ms dmd 2.102.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 28ms 0.4ms 3.0MB 20ms 0ms ldc2 1.30.0
d 1.d 118ms 0.5ms 3.7MB 110ms 0ms dmd 2.102.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 728ms 1.1ms 89.4MB 737ms 30ms deno 1.30.2
d 1.d 1591ms 1.6ms 74.8MB 1653ms 17ms ldc2 1.30.0
d 1.d 2722ms 3.1ms 154.0MB 3030ms 40ms dmd 2.102.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 187ms 1.6ms 57.3MB 187ms 13ms deno 1.30.2
d 1.d 316ms 1.9ms 38.9MB 293ms 10ms ldc2 1.30.0
d 1.d 560ms 4.4ms 40.4MB 600ms 3ms dmd 2.102.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 463ms 0.1ms 1.6MB 450ms 0ms ldc2 1.30.0
d 2.d 468ms 1.8ms 1.6MB 457ms 0ms ldc2 1.30.0
typescript 6.ts 751ms 8.4ms 37.1MB 737ms 0ms deno 1.30.2
d 1.d 1242ms 0.2ms 2.7MB 1230ms 0ms dmd 2.102.0
d 2.d 2199ms 6.7ms 2.6MB 2190ms 0ms dmd 2.102.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 49ms 0.3ms 1.5MB 40ms 0ms ldc2 1.30.0
d 2.d 51ms 0.2ms 1.6MB 40ms 0ms ldc2 1.30.0
typescript 6.ts 107ms 4.2ms 37.2MB 97ms 0ms deno 1.30.2
d 1.d 127ms 0.3ms 2.6MB 117ms 0ms dmd 2.102.0
d 2.d 224ms 2.2ms 2.6MB 210ms 0ms dmd 2.102.0

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 851ms 3.2ms 48.4MB 813ms 23ms ldc2 1.30.0
d 1.d 973ms 36ms 75.3MB 937ms 17ms dmd 2.102.0
d 1.d 1253ms 18ms 42.4MB 1220ms 13ms ldc2 1.30.0
d 2.d 1558ms 2.0ms 49.9MB 1530ms 10ms dmd 2.102.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 129ms 7.2ms 13.4MB 113ms 0ms ldc2 1.30.0
d 1.d 140ms 1.8ms 24.6MB 127ms 3ms dmd 2.102.0
d 2.d 196ms 1.4ms 15.1MB 180ms 0ms ldc2 1.30.0
d 2.d 386ms 0.7ms 16.1MB 370ms 0ms dmd 2.102.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 3024ms 5.6ms 7.8MB 3013ms 20ms ldc2 1.30.0
d 1.d timeout 0.0ms 9.4MB 5000ms 7ms dmd 2.102.0
typescript 3.ts timeout 0.0ms 79.1MB 4950ms 37ms deno 1.30.2

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 729ms 3.5ms 7.9MB 717ms 0ms ldc2 1.30.0
d 1.d 1409ms 1.1ms 9.4MB 1393ms 7ms dmd 2.102.0
typescript 3.ts 1466ms 19ms 57.6MB 1403ms 73ms deno 1.30.2

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 3.d 765ms 5.5ms 170.8MB 933ms 60ms ldc2 1.30.0
d 3.d 1684ms 8.3ms 171.4MB 1860ms 63ms dmd 2.102.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 3.d 84ms 1.7ms 24.9MB 83ms 7ms ldc2 1.30.0
d 3.d 176ms 3.3ms 25.3MB 183ms 0ms dmd 2.102.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 3043ms 18ms 37.7MB 3040ms 7ms deno 1.30.2
d 1.d timeout 0.0ms 6.0MB 5003ms 0ms dmd 2.102.0
d 1.d timeout 0.0ms 3.7MB 4987ms 13ms ldc2 1.30.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 791ms 9.2ms 38.0MB 797ms 7ms deno 1.30.2
d 1.d 1514ms 25ms 3.7MB 1500ms 7ms ldc2 1.30.0
d 1.d 2995ms 5.5ms 6.0MB 2987ms 0ms dmd 2.102.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 3633ms 1.8ms 3.8MB 3620ms 0ms ldc2 1.30.0
d 1.d 4206ms 8.2ms 5.5MB 4187ms 3ms dmd 2.102.0
typescript 7.ts timeout 0.0ms 39.1MB 4987ms 3ms deno 1.30.2

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 913ms 2.2ms 3.6MB 900ms 0ms ldc2 1.30.0
d 1.d 1054ms 0.3ms 4.7MB 1040ms 0ms dmd 2.102.0
typescript 7.ts 1361ms 17ms 37.9MB 1340ms 7ms deno 1.30.2

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 232ms 1.2ms 3.2MB 220ms 0ms ldc2 1.30.0
d 1.d 268ms 1.9ms 4.2MB 257ms 0ms dmd 2.102.0
typescript 7.ts 423ms 66ms 38.3MB 353ms 13ms deno 1.30.2