D VS Go benchmarks

Current benchmark data was generated on Mon Jun 23 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
go 1.go 1752ms 19ms 51.9MB 1730ms 10ms tinygo 0.38.0
d 1.d 2244ms 4.4ms 312.4MB 2210ms 43ms ldc2 1.41.0
go 1-m.go 2372ms 7.5ms 42.0MB 5283ms 43ms go 1.24.4
d 1.d 3045ms 8.9ms 315.0MB 3220ms 50ms dmd 2.111.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 154ms 0.3ms 5.0MB 140ms 0ms tinygo 0.38.0
d 1.d 208ms 3.2ms 207.1MB 190ms 10ms ldc2 1.41.0
go 1-m.go 209ms 2.0ms 7.9MB 373ms 7ms go 1.24.4
d 1.d 261ms 1.1ms 208.7MB 237ms 13ms dmd 2.111.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 521ms 70ms 15.5MB 2027ms 3ms go 1.24.4
d 1.d timeout 0.0ms 18.2MB 4963ms 23ms dmd 2.111.0
d 1.d timeout 0.0ms 15.3MB 4957ms 27ms ldc2 1.41.0
go 1.go timeout 0.0ms 13.3MB 2440ms 17150ms tinygo 0.38.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 47ms 13ms 7.4MB 160ms 0ms go 1.24.4
go 1-m.go 619ms 19ms 4.3MB 277ms 1990ms tinygo 0.38.0
d 1.d 1081ms 24ms 10.3MB 1053ms 17ms ldc2 1.41.0
d 1.d 1398ms 9.7ms 12.3MB 1370ms 13ms dmd 2.111.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 118ms 1.1ms 8.5MB 107ms 0ms go 1.24.4
d 1.d 2555ms 6.6ms 8.0MB 2543ms 0ms ldc2 1.41.0
d 1.d 2868ms 6.9ms 10.4MB 2853ms 0ms dmd 2.111.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 34ms 0.1ms 8.2MB 30ms 0ms go 1.24.4
d 1.d 442ms 1.2ms 8.1MB 430ms 0ms ldc2 1.41.0
d 1.d 519ms 1.1ms 10.5MB 510ms 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 379ms 0.9ms 3.0MB 1427ms 0ms ldc2 1.41.0
go 3-m.go 673ms 1.0ms 5.6MB 2600ms 0ms go 1.24.4
go 3-m.go 726ms 2.7ms 2.9MB 2673ms 37ms tinygo 0.38.0
d 2-im.d 1124ms 2.7ms 3.0MB 4320ms 0ms ldc2 1.41.0
d 1-i.d 1487ms 0.9ms 2.9MB 1480ms 0ms ldc2 1.41.0
d 1.d 3114ms 14ms 2.9MB 3107ms 0ms ldc2 1.41.0
d 2-i.d 3236ms 19ms 2.9MB 3230ms 0ms ldc2 1.41.0
d 1.d 3542ms 12ms 4.8MB 3533ms 0ms dmd 2.111.0
d 1-im.d 4502ms 67ms 4.8MB 17493ms 7ms dmd 2.111.0
d 1-i.d timeout 0.0ms 4.5MB 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 19737ms 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 39ms 2.8ms 2.9MB 110ms 0ms ldc2 1.41.0
go 3-m.go 74ms 0.2ms 5.5MB 197ms 0ms go 1.24.4
d 2-im.d 99ms 1.5ms 3.0MB 343ms 0ms ldc2 1.41.0
go 3-m.go 102ms 2.8ms 2.9MB 187ms 33ms tinygo 0.38.0
d 1-i.d 124ms 0.5ms 2.9MB 117ms 0ms ldc2 1.41.0
d 1.d 265ms 1.9ms 2.9MB 257ms 0ms ldc2 1.41.0
d 2-i.d 266ms 1.3ms 2.9MB 260ms 0ms ldc2 1.41.0
d 1.d 298ms 3.2ms 4.6MB 290ms 0ms dmd 2.111.0
d 1-im.d 376ms 1.8ms 4.9MB 1430ms 0ms dmd 2.111.0
d 2-im.d 530ms 2.8ms 4.9MB 2010ms 0ms dmd 2.111.0
d 1-i.d 893ms 17ms 4.6MB 883ms 0ms dmd 2.111.0
d 2-i.d 1386ms 12ms 4.5MB 1377ms 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 112ms 2.0ms 2.9MB 103ms 0ms ldc2 1.41.0
go 3-m.go 125ms 0.3ms 7.5MB 380ms 0ms go 1.24.4
d 1.d 653ms 24ms 4.8MB 643ms 0ms dmd 2.111.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 15ms 1.4ms 2.9MB 10ms 0ms ldc2 1.41.0
go 3-m.go 17ms 0.6ms 7.6MB 30ms 0ms go 1.24.4
d 1.d 68ms 1.5ms 4.8MB 60ms 0ms dmd 2.111.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 0.7ms 0.0ms 0.3MB 0ms 0ms tinygo 0.38.0
go 1.go 1.4ms 0.1ms 3.4MB 0ms 0ms go 1.24.4
d 1.d 1.7ms 0.2ms 3.0MB 0ms 0ms ldc2 1.41.0
d 1.d 1.9ms 0.2ms 5.1MB 0ms 0ms dmd 2.111.0

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2-ffi.go 46ms 0.4ms 41.2MB 37ms 7ms go 1.24.4
d 2.d 59ms 1.2ms 15.8MB 63ms 7ms ldc2 1.41.0
go 1.go 141ms 2.5ms 18.6MB 133ms 0ms go 1.24.4
d 2.d 238ms 1.3ms 22.5MB 243ms 7ms dmd 2.111.0

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2-ffi.go 253ms 3.8ms 153.2MB 243ms 40ms go 1.24.4
d 2.d 472ms 2.8ms 139.9MB 443ms 33ms ldc2 1.41.0
go 1.go 742ms 5.5ms 105.0MB 730ms 13ms go 1.24.4
d 2.d 2491ms 24ms 158.6MB 2507ms 40ms dmd 2.111.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-m.d 675ms 14ms 47.5MB 2167ms 10ms ldc2 1.41.0
go 7-m.go 676ms 7.8ms 38.9MB 2393ms 23ms go 1.24.4
d 1-m.d 1936ms 52ms 50.6MB 6107ms 10ms dmd 2.111.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-m.d 95ms 3.5ms 38.7MB 263ms 7ms ldc2 1.41.0
go 7-m.go 130ms 2.8ms 23.9MB 343ms 23ms go 1.24.4
d 1-m.d 211ms 8.5ms 40.9MB 643ms 13ms dmd 2.111.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 121ms 1.2ms 3.5MB 113ms 0ms go 1.24.4
go 3.go 132ms 2.6ms 0.4MB 127ms 0ms tinygo 0.38.0
d 1.d 133ms 2.9ms 5.9MB 127ms 3ms ldc2 1.41.0
d 1.d 175ms 1.0ms 8.0MB 163ms 3ms dmd 2.111.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 382ms 1.3ms 5.9MB 370ms 17ms ldc2 1.41.0
go 3.go 383ms 2.1ms 0.4MB 373ms 0ms tinygo 0.38.0
go 3.go 394ms 12ms 3.5MB 387ms 0ms go 1.24.4
d 1.d 515ms 2.4ms 7.9MB 510ms 13ms dmd 2.111.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 51ms 1.2ms 3.5MB 40ms 0ms go 1.24.4
d 1.d 59ms 1.7ms 6.1MB 50ms 0ms ldc2 1.41.0
go 3.go 67ms 2.9ms 0.3MB 60ms 0ms tinygo 0.38.0
d 1.d 80ms 1.6ms 8.2MB 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 368ms 0.4ms 7.6MB 360ms 0ms ldc2 1.41.0
d 1.d 2121ms 34ms 9.4MB 2110ms 0ms dmd 2.111.0
go 1.go 3227ms 6.6ms 7.7MB 3220ms 0ms go 1.24.4
go 1.go 3605ms 41ms 3.3MB 3593ms 0ms tinygo 0.38.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 18ms 0.2ms 3.1MB 10ms 0ms ldc2 1.41.0
d 1.d 92ms 2.7ms 4.6MB 83ms 0ms dmd 2.111.0
go 1.go 137ms 3.0ms 3.6MB 130ms 0ms go 1.24.4
go 1.go 152ms 4.4ms 0.4MB 143ms 0ms tinygo 0.38.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 1049ms 0.9ms 35.4MB 1030ms 0ms tinygo 0.38.0
d 1.d 1113ms 6.0ms 312.4MB 1077ms 37ms ldc2 1.41.0
go 2.go 1343ms 6.2ms 51.9MB 1317ms 10ms tinygo 0.38.0
go 1-m.go 1463ms 6.3ms 38.9MB 3117ms 33ms go 1.24.4
go 2-m.go 1677ms 22ms 40.9MB 3687ms 33ms go 1.24.4
d 1.d 1847ms 15ms 314.6MB 1973ms 47ms dmd 2.111.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 211ms 4.8ms 11.6MB 197ms 0ms tinygo 0.38.0
d 1.d 226ms 1.5ms 312.5MB 190ms 23ms ldc2 1.41.0
go 2.go 258ms 3.7ms 15.4MB 247ms 0ms tinygo 0.38.0
go 1-m.go 340ms 9.7ms 12.1MB 670ms 23ms go 1.24.4
d 1.d 357ms 2.6ms 314.8MB 323ms 30ms dmd 2.111.0
go 2-m.go 372ms 0.6ms 14.0MB 787ms 20ms go 1.24.4

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 346ms 1.4ms 0.3MB 337ms 0ms tinygo 0.38.0
go 1.go 349ms 1.6ms 3.5MB 340ms 0ms go 1.24.4
d 2.d 361ms 1.5ms 2.9MB 350ms 0ms ldc2 1.41.0
d 1.d 361ms 1.0ms 2.9MB 350ms 0ms ldc2 1.41.0
d 1.d 683ms 2.8ms 4.6MB 673ms 0ms dmd 2.111.0
d 2.d 2027ms 4.0ms 4.6MB 2017ms 0ms dmd 2.111.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 36ms 0.4ms 0.3MB 30ms 0ms tinygo 0.38.0
go 1.go 37ms 0.1ms 3.5MB 30ms 0ms go 1.24.4
d 1.d 38ms 0.4ms 2.9MB 30ms 0ms ldc2 1.41.0
d 2.d 39ms 0.4ms 2.9MB 30ms 0ms ldc2 1.41.0
d 1.d 71ms 1.3ms 4.8MB 60ms 0ms dmd 2.111.0
d 2.d 213ms 7.6ms 4.8MB 203ms 0ms dmd 2.111.0

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 300ms 4.8ms 71.7MB 287ms 0ms go 1.24.4
d 1.d 326ms 4.7ms 45.7MB 310ms 0ms ldc2 1.41.0
go 1.go 349ms 21ms 39.5MB 337ms 0ms tinygo 0.38.0
d 1.d 378ms 9.9ms 79.3MB 360ms 3ms dmd 2.111.0
go 2.go 469ms 3.1ms 20.0MB 457ms 0ms tinygo 0.38.0
go 2.go 747ms 5.8ms 21.7MB 733ms 10ms go 1.24.4
d 2.d 846ms 1.8ms 49.7MB 827ms 10ms ldc2 1.41.0
d 2.d 1175ms 4.5ms 51.7MB 1150ms 13ms dmd 2.111.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 57ms 3.3ms 21.5MB 50ms 0ms go 1.24.4
d 1.d 62ms 2.9ms 15.7MB 50ms 0ms ldc2 1.41.0
go 1.go 64ms 4.2ms 10.1MB 53ms 0ms tinygo 0.38.0
d 1.d 76ms 1.4ms 25.3MB 60ms 0ms dmd 2.111.0
go 2.go 117ms 4.5ms 4.1MB 110ms 0ms tinygo 0.38.0
go 2.go 187ms 2.3ms 6.3MB 177ms 0ms go 1.24.4
d 2.d 212ms 2.5ms 17.7MB 197ms 0ms ldc2 1.41.0
d 2.d 295ms 1.4ms 19.8MB 280ms 0ms dmd 2.111.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 8.go 1174ms 6.0ms 10.6MB 1160ms 3ms go 1.24.4
d 1.d 2448ms 17ms 8.1MB 2423ms 410ms ldc2 1.41.0
d 1.d 4455ms 6.5ms 10.5MB 4357ms 523ms dmd 2.111.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 8.go 278ms 2.4ms 8.6MB 267ms 0ms go 1.24.4
d 1.d 585ms 1.9ms 8.1MB 563ms 107ms ldc2 1.41.0
d 1.d 1056ms 1.9ms 10.3MB 1033ms 117ms dmd 2.111.0

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 3.d 579ms 2.7ms 172.3MB 760ms 23ms ldc2 1.41.0
d 3.d 1221ms 2.5ms 175.1MB 1400ms 33ms dmd 2.111.0
go 3.go timeout 0.0ms 122.3MB 4983ms 43ms go 1.24.4
go 3.go timeout 0.0ms 85.0MB 4973ms 10ms tinygo 0.38.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 3.d 67ms 4.3ms 28.6MB 73ms 0ms ldc2 1.41.0
d 3.d 131ms 3.2ms 31.5MB 140ms 0ms dmd 2.111.0
go 3.go 1798ms 95ms 20.2MB 1780ms 27ms go 1.24.4
go 3.go 2264ms 20ms 23.3MB 2247ms 0ms tinygo 0.38.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 0-ffi.go 92ms 1.0ms 5.2MB 90ms 0ms go 1.24.4
d 1.d 4805ms 14ms 4.0MB 4753ms 380ms ldc2 1.41.0
d 1.d timeout 0.0ms 6.6MB 4943ms 310ms dmd 2.111.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 0-ffi.go 26ms 0.6ms 5.2MB 20ms 0ms go 1.24.4
d 1.d 1209ms 8.6ms 3.9MB 1190ms 93ms ldc2 1.41.0
d 1.d 2040ms 12ms 6.5MB 2020ms 113ms dmd 2.111.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 1917ms 15ms 5.5MB 7387ms 13ms go 1.24.4
d 1.d 3601ms 8.6ms 6.1MB 3593ms 0ms ldc2 1.41.0
go 1.go 3646ms 8.0ms 5.6MB 3637ms 0ms go 1.24.4
d 1.d 3668ms 32ms 8.4MB 3657ms 0ms dmd 2.111.0
go 1.go timeout 0.0ms 0.5MB 4990ms 0ms tinygo 0.38.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 481ms 1.8ms 5.6MB 1843ms 0ms go 1.24.4
d 1.d 911ms 17ms 3.8MB 900ms 0ms ldc2 1.41.0
go 1.go 915ms 1.3ms 3.5MB 907ms 0ms go 1.24.4
d 1.d 915ms 7.3ms 5.4MB 907ms 0ms dmd 2.111.0
go 1.go 1397ms 1.7ms 0.4MB 1387ms 0ms tinygo 0.38.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 126ms 0.7ms 5.6MB 450ms 0ms go 1.24.4
d 1.d 229ms 1.2ms 3.1MB 220ms 0ms ldc2 1.41.0
go 1.go 231ms 1.9ms 3.5MB 220ms 0ms go 1.24.4
d 1.d 235ms 1.0ms 5.0MB 223ms 0ms dmd 2.111.0
go 1.go 351ms 0.1ms 0.4MB 340ms 0ms tinygo 0.38.0