D VS Haxe benchmarks

Current benchmark data was generated on Fri Aug 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
haxe 1.hx 1290ms 13ms 144.0MB 1470ms 67ms haxe/cpp 4.3.6
d 1.d 2187ms 1.9ms 312.5MB 2160ms 33ms ldc2 1.41.0
d 1.d 3000ms 18ms 314.1MB 3163ms 50ms dmd 2.111.0
haxe 2.hx 4336ms 13ms 495.3MB 4867ms 253ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 48.6MB 5457ms 423ms haxe/hl/c 4.3.6
haxe 2.hx timeout 0.0ms 83.0MB 5003ms 683ms haxe/hl/c 4.3.6
haxe 1.hx timeout 0.0ms 51.1MB 7750ms 430ms haxe/hl/jit 1.16.0
haxe 2.hx timeout 0.0ms 131.0MB 7297ms 770ms haxe/hl/jit 1.16.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
haxe 1.hx 88ms 0.4ms 25.6MB 77ms 10ms haxe/cpp 4.3.6
d 1.d 205ms 3.2ms 207.9MB 180ms 13ms ldc2 1.41.0
d 1.d 262ms 1.9ms 209.7MB 237ms 10ms dmd 2.111.0
haxe 2.hx 380ms 5.8ms 58.3MB 410ms 20ms haxe/cpp 4.3.6
haxe 1.hx 640ms 2.4ms 8.7MB 613ms 43ms haxe/hl/c 4.3.6
haxe 1.hx 671ms 4.4ms 11.4MB 727ms 57ms haxe/hl/jit 1.16.0
haxe 2.hx 930ms 3.9ms 13.6MB 817ms 157ms haxe/hl/c 4.3.6
haxe 2.hx 940ms 11ms 25.0MB 910ms 170ms haxe/hl/jit 1.16.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d timeout 0.0ms 16.5MB 4970ms 17ms dmd 2.111.0
d 1.d timeout 0.0ms 17.5MB 4963ms 27ms ldc2 1.41.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 1058ms 5.4ms 10.2MB 1033ms 10ms ldc2 1.41.0
d 1.d 1373ms 11ms 12.5MB 1350ms 10ms dmd 2.111.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 2555ms 1.6ms 8.1MB 2543ms 0ms ldc2 1.41.0
d 1.d 2870ms 7.3ms 10.4MB 2860ms 0ms dmd 2.111.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 443ms 3.2ms 8.1MB 430ms 0ms ldc2 1.41.0
d 1.d 517ms 0.4ms 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 374ms 6.5ms 3.0MB 1420ms 0ms ldc2 1.41.0
d 2-im.d 1109ms 4.2ms 3.0MB 4320ms 0ms ldc2 1.41.0
d 1-i.d 1489ms 0.4ms 2.9MB 1480ms 0ms ldc2 1.41.0
d 1.d 3152ms 15ms 2.9MB 3140ms 0ms ldc2 1.41.0
d 2-i.d 3224ms 2.6ms 2.9MB 3213ms 0ms ldc2 1.41.0
d 1.d 3538ms 5.1ms 4.6MB 3527ms 0ms dmd 2.111.0
d 1-im.d 4488ms 40ms 4.9MB 17597ms 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 19753ms 7ms dmd 2.111.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1-im.d 36ms 1.2ms 3.1MB 110ms 0ms ldc2 1.41.0
d 2-im.d 97ms 2.1ms 3.0MB 350ms 0ms ldc2 1.41.0
d 1-i.d 124ms 0.3ms 2.9MB 120ms 0ms ldc2 1.41.0
d 1.d 261ms 0.5ms 2.9MB 250ms 0ms ldc2 1.41.0
d 2-i.d 266ms 1.0ms 2.9MB 260ms 0ms ldc2 1.41.0
d 1.d 297ms 2.2ms 4.6MB 287ms 0ms dmd 2.111.0
d 1-im.d 376ms 0.8ms 4.8MB 1433ms 0ms dmd 2.111.0
d 2-im.d 525ms 3.2ms 5.1MB 2010ms 0ms dmd 2.111.0
d 1-i.d 880ms 8.2ms 4.6MB 870ms 0ms dmd 2.111.0
d 2-i.d 1375ms 1.1ms 4.6MB 1363ms 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.7ms 2.9MB 103ms 0ms ldc2 1.41.0
d 1.d 641ms 1.0ms 4.6MB 630ms 0ms dmd 2.111.0
haxe 1.hx 2378ms 10ms 25.6MB 2270ms 190ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 3.1MB 4333ms 880ms haxe/hl/c 4.3.6
haxe 1.hx timeout 0.0ms 3.6MB 4383ms 850ms haxe/hl/jit 1.16.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 14ms 0.5ms 2.9MB 10ms 0ms ldc2 1.41.0
d 1.d 67ms 0.8ms 4.8MB 60ms 0ms dmd 2.111.0
haxe 1.hx 251ms 2.7ms 25.6MB 220ms 30ms haxe/cpp 4.3.6
haxe 1.hx 667ms 6.6ms 3.5MB 577ms 103ms haxe/hl/c 4.3.6
haxe 1.hx 698ms 6.6ms 3.6MB 617ms 107ms haxe/hl/jit 1.16.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 1.6ms 0.1ms 2.9MB 0ms 0ms ldc2 1.41.0
haxe 1.hx 1.9ms 0.2ms 2.9MB 0ms 0ms haxe/hl/c 4.3.6
d 1.d 2.0ms 0.2ms 5.1MB 0ms 0ms dmd 2.111.0
haxe 1.hx 2.3ms 0.3ms 4.4MB 0ms 0ms haxe/cpp 4.3.6
haxe 1.hx 3.4ms 0.4ms 2.9MB 0ms 0ms haxe/hl/jit 1.16.0

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 58ms 1.1ms 15.9MB 60ms 7ms ldc2 1.41.0
d 2.d 237ms 2.6ms 22.6MB 240ms 7ms dmd 2.111.0

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 464ms 5.0ms 140.4MB 437ms 30ms ldc2 1.41.0
d 2.d 2479ms 20ms 158.4MB 2493ms 37ms 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 639ms 21ms 47.9MB 2073ms 10ms ldc2 1.41.0
d 1-m.d 1884ms 33ms 50.0MB 5657ms 13ms 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 92ms 1.5ms 38.7MB 253ms 7ms ldc2 1.41.0
d 1-m.d 212ms 8.4ms 40.9MB 610ms 13ms dmd 2.111.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 130ms 1.7ms 6.1MB 120ms 0ms ldc2 1.41.0
haxe 1.hx 134ms 1.8ms 20.4MB 120ms 7ms haxe/cpp 4.3.6
haxe 1.hx 135ms 0.3ms 3.3MB 127ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 157ms 3.8ms 3.8MB 147ms 0ms haxe/hl/jit 1.16.0
d 1.d 176ms 2.3ms 8.1MB 163ms 7ms dmd 2.111.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
haxe 1.hx 378ms 5.6ms 25.5MB 363ms 10ms haxe/cpp 4.3.6
d 1.d 380ms 0.5ms 5.9MB 370ms 10ms ldc2 1.41.0
haxe 1.hx 398ms 6.1ms 3.1MB 387ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 459ms 7.2ms 3.8MB 450ms 0ms haxe/hl/jit 1.16.0
d 1.d 510ms 2.8ms 8.2MB 500ms 10ms dmd 2.111.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 57ms 1.3ms 5.9MB 50ms 0ms ldc2 1.41.0
haxe 1.hx 63ms 0.7ms 12.3MB 50ms 0ms haxe/cpp 4.3.6
haxe 1.hx 67ms 0.6ms 3.0MB 60ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 77ms 0.7ms 3.6MB 70ms 0ms haxe/hl/jit 1.16.0
d 1.d 79ms 0.2ms 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 367ms 0.6ms 7.5MB 357ms 0ms ldc2 1.41.0
d 1.d 2107ms 12ms 9.4MB 2097ms 0ms dmd 2.111.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 17ms 0.1ms 3.0MB 10ms 0ms ldc2 1.41.0
d 1.d 91ms 2.3ms 4.6MB 83ms 0ms dmd 2.111.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
haxe 1.hx 908ms 5.7ms 94.9MB 1010ms 40ms haxe/cpp 4.3.6
d 1.d 1093ms 13ms 312.6MB 1057ms 37ms ldc2 1.41.0
d 1.d 1863ms 29ms 314.3MB 1990ms 47ms dmd 2.111.0
haxe 1.hx timeout 0.0ms 32.5MB 4877ms 553ms haxe/hl/c 4.3.6
haxe 1.hx timeout 0.0ms 55.1MB 5960ms 490ms haxe/hl/jit 1.16.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
haxe 1.hx 170ms 4.0ms 26.6MB 173ms 10ms haxe/cpp 4.3.6
d 1.d 227ms 2.7ms 312.5MB 193ms 20ms ldc2 1.41.0
d 1.d 359ms 1.1ms 315.0MB 323ms 27ms dmd 2.111.0
haxe 1.hx 1306ms 1.8ms 10.8MB 1253ms 140ms haxe/hl/c 4.3.6
haxe 1.hx 1322ms 7.0ms 20.2MB 1330ms 127ms haxe/hl/jit 1.16.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 361ms 0.5ms 2.9MB 350ms 0ms ldc2 1.41.0
d 2.d 361ms 1.4ms 2.9MB 350ms 0ms ldc2 1.41.0
d 1.d 683ms 2.2ms 4.8MB 673ms 0ms dmd 2.111.0
haxe 2.hx 856ms 3.6ms 3.0MB 847ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 1084ms 8.6ms 3.0MB 1073ms 0ms haxe/hl/c 4.3.6
haxe 3.hx 1407ms 30ms 25.6MB 1560ms 30ms haxe/cpp 4.3.6
d 2.d 2033ms 7.1ms 4.8MB 2023ms 0ms dmd 2.111.0
haxe 2.hx 2414ms 4.4ms 3.6MB 2403ms 0ms haxe/hl/jit 1.16.0
haxe 1.hx 2476ms 3.3ms 3.6MB 2467ms 0ms haxe/hl/jit 1.16.0
haxe 1.hx timeout 0.0ms 4.4MB 4990ms 0ms haxe/cpp 4.3.6
haxe 2.hx timeout 0.0ms 4.5MB 4990ms 0ms haxe/cpp 4.3.6
haxe 3.hx timeout 0.0ms 3.2MB 3920ms 1573ms haxe/hl/c 4.3.6
haxe 3.hx timeout 0.0ms 3.9MB 4133ms 1323ms haxe/hl/jit 1.16.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 39ms 0.7ms 2.9MB 30ms 0ms ldc2 1.41.0
d 1.d 39ms 0.3ms 2.9MB 30ms 0ms ldc2 1.41.0
d 1.d 71ms 1.1ms 4.8MB 60ms 0ms dmd 2.111.0
haxe 2.hx 88ms 0.2ms 3.0MB 80ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 111ms 2.9ms 3.1MB 103ms 0ms haxe/hl/c 4.3.6
haxe 3.hx 153ms 2.6ms 25.6MB 147ms 10ms haxe/cpp 4.3.6
d 2.d 208ms 2.9ms 4.8MB 200ms 0ms dmd 2.111.0
haxe 2.hx 244ms 1.1ms 3.6MB 237ms 0ms haxe/hl/jit 1.16.0
haxe 1.hx 253ms 2.2ms 3.6MB 243ms 0ms haxe/hl/jit 1.16.0
haxe 2.hx 674ms 7.0ms 4.4MB 663ms 0ms haxe/cpp 4.3.6
haxe 3.hx 676ms 2.5ms 3.3MB 530ms 203ms haxe/hl/c 4.3.6
haxe 3.hx 795ms 13ms 3.8MB 643ms 210ms haxe/hl/jit 1.16.0
haxe 1.hx 812ms 5.7ms 4.4MB 803ms 0ms haxe/cpp 4.3.6

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 303ms 7.2ms 43.5MB 287ms 0ms ldc2 1.41.0
d 1.d 345ms 5.5ms 79.3MB 327ms 3ms dmd 2.111.0
d 2.d 846ms 5.3ms 47.7MB 827ms 7ms ldc2 1.41.0
d 2.d 1170ms 7.1ms 51.6MB 1150ms 7ms dmd 2.111.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 64ms 2.7ms 15.7MB 53ms 0ms ldc2 1.41.0
d 1.d 75ms 1.7ms 25.5MB 67ms 0ms dmd 2.111.0
d 2.d 210ms 2.0ms 17.7MB 200ms 0ms ldc2 1.41.0
d 2.d 295ms 1.1ms 19.7MB 280ms 0ms dmd 2.111.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 2445ms 17ms 8.1MB 2407ms 423ms ldc2 1.41.0
d 1.d 4429ms 2.9ms 10.5MB 4383ms 463ms dmd 2.111.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 582ms 3.3ms 8.2MB 557ms 110ms ldc2 1.41.0
d 1.d 1056ms 3.2ms 10.4MB 1033ms 110ms 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 584ms 1.7ms 172.2MB 767ms 20ms ldc2 1.41.0
d 3.d 1200ms 3.9ms 177.3MB 1387ms 27ms dmd 2.111.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 3.d 63ms 0.8ms 26.3MB 70ms 0ms ldc2 1.41.0
d 3.d 126ms 0.9ms 31.7MB 137ms 0ms dmd 2.111.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 4859ms 111ms 4.3MB 4827ms 367ms ldc2 1.41.0
d 1.d timeout 0.0ms 6.5MB 4960ms 297ms dmd 2.111.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 1214ms 8.8ms 3.9MB 1190ms 100ms ldc2 1.41.0
d 1.d 2046ms 14ms 6.5MB 2037ms 100ms 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 3597ms 3.2ms 6.2MB 3587ms 0ms ldc2 1.41.0
d 1.d 3655ms 25ms 8.4MB 3643ms 0ms dmd 2.111.0
haxe 1.hx 3897ms 3.5ms 3.4MB 3883ms 0ms haxe/hl/c 4.3.6
haxe 1.hx timeout 0.0ms 7.0MB 4990ms 0ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 3.9MB 4990ms 0ms haxe/hl/jit 1.16.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 901ms 0.9ms 3.5MB 890ms 0ms ldc2 1.41.0
d 1.d 921ms 9.3ms 5.3MB 910ms 0ms dmd 2.111.0
haxe 1.hx 987ms 3.6ms 3.2MB 977ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 2398ms 1.7ms 6.5MB 2387ms 0ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 3.8MB 4990ms 0ms haxe/hl/jit 1.16.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 228ms 1.4ms 3.3MB 220ms 0ms ldc2 1.41.0
d 1.d 233ms 1.9ms 7.2MB 220ms 0ms dmd 2.111.0
haxe 1.hx 250ms 1.8ms 3.0MB 240ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 602ms 0.3ms 5.4MB 590ms 0ms haxe/cpp 4.3.6
haxe 1.hx 2306ms 17ms 3.8MB 2297ms 0ms haxe/hl/jit 1.16.0