Rust VS Haxe 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.)

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 1.2ms 0.1ms 1.8MB 0ms 0ms rustc 1.87.0
rust 1.rs 1.2ms 0.0ms 1.8MB 0ms 0ms rustc 1.89.0-nightly
haxe 1.hx 2.1ms 0.3ms 4.4MB 0ms 0ms haxe/cpp 4.3.6
haxe 1.hx 2.2ms 0.4ms 2.9MB 0ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 3.4ms 0.3ms 3.4MB 0ms 0ms haxe/hl/jit 1.15.0

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 9.rs 256ms 17ms 4.8MB 250ms 0ms rustc 1.89.0-nightly
rust 8.rs 293ms 1.7ms 4.9MB 283ms 0ms rustc 1.87.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 9.rs 12ms 0.5ms 2.0MB 0ms 0ms rustc 1.89.0-nightly
rust 8.rs 14ms 0.1ms 2.0MB 10ms 0ms rustc 1.87.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 164ms 0.9ms 1.9MB 160ms 0ms rustc 1.87.0
rust 7-i.rs 219ms 0.9ms 1.8MB 210ms 0ms rustc 1.87.0
rust 1.rs 230ms 0.5ms 1.9MB 220ms 0ms rustc 1.87.0
rust 3.rs 279ms 0.3ms 1.9MB 270ms 0ms rustc 1.89.0-nightly
rust 2.rs 279ms 0.6ms 1.8MB 270ms 0ms rustc 1.87.0
haxe 2.hx 856ms 3.7ms 3.0MB 847ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 1062ms 2.4ms 3.0MB 1053ms 0ms haxe/hl/c 4.3.6
haxe 3.hx 1395ms 8.8ms 25.6MB 1580ms 30ms haxe/cpp 4.3.6
haxe 2.hx 2408ms 11ms 3.6MB 2397ms 0ms haxe/hl/jit 1.15.0
haxe 1.hx 2475ms 15ms 3.6MB 2467ms 0ms haxe/hl/jit 1.15.0
haxe 1.hx timeout 0.0ms 4.4MB 4990ms 0ms haxe/cpp 4.3.6
haxe 2.hx timeout 0.0ms 4.4MB 4990ms 0ms haxe/cpp 4.3.6
haxe 3.hx timeout 0.0ms 3.4MB 3933ms 1573ms haxe/hl/c 4.3.6
haxe 3.hx timeout 0.0ms 3.9MB 4137ms 1327ms haxe/hl/jit 1.15.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 19ms 0.1ms 1.8MB 10ms 0ms rustc 1.87.0
rust 7-i.rs 24ms 0.2ms 1.8MB 20ms 0ms rustc 1.87.0
rust 1.rs 25ms 0.2ms 1.8MB 20ms 0ms rustc 1.87.0
rust 3.rs 30ms 0.1ms 1.8MB 20ms 0ms rustc 1.89.0-nightly
rust 2.rs 30ms 0.4ms 1.8MB 20ms 0ms rustc 1.87.0
haxe 2.hx 88ms 0.0ms 3.0MB 80ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 111ms 2.1ms 3.0MB 103ms 0ms haxe/hl/c 4.3.6
haxe 3.hx 156ms 2.4ms 25.6MB 157ms 10ms haxe/cpp 4.3.6
haxe 2.hx 245ms 0.4ms 3.6MB 237ms 0ms haxe/hl/jit 1.15.0
haxe 1.hx 259ms 3.6ms 3.6MB 247ms 0ms haxe/hl/jit 1.15.0
haxe 2.hx 674ms 3.1ms 4.4MB 667ms 0ms haxe/cpp 4.3.6
haxe 3.hx 679ms 4.5ms 3.3MB 513ms 223ms haxe/hl/c 4.3.6
haxe 3.hx 800ms 16ms 3.8MB 657ms 203ms haxe/hl/jit 1.15.0
haxe 1.hx 811ms 7.7ms 4.6MB 803ms 0ms haxe/cpp 4.3.6

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 7-m.rs 492ms 0.0ms 2.1MB 1907ms 7ms rustc 1.87.0
rust 8-m.rs 497ms 4.4ms 2.4MB 1893ms 3ms rustc 1.89.0-nightly
rust 8.rs 991ms 0.5ms 2.3MB 980ms 0ms rustc 1.89.0-nightly
rust 7.rs 1957ms 10ms 1.9MB 1947ms 0ms rustc 1.87.0
rust 2-m.rs 2070ms 0.9ms 2.3MB 8153ms 7ms rustc 1.87.0
haxe 1.hx 3907ms 10ms 3.3MB 3893ms 0ms haxe/hl/c 4.3.6
rust 2.rs 4266ms 8.9ms 2.1MB 4257ms 0ms rustc 1.87.0
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.15.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 7-m.rs 128ms 0.4ms 2.1MB 470ms 0ms rustc 1.87.0
rust 8-m.rs 128ms 0.2ms 2.3MB 470ms 0ms rustc 1.89.0-nightly
rust 8.rs 250ms 0.1ms 2.1MB 240ms 0ms rustc 1.89.0-nightly
rust 7.rs 495ms 6.2ms 1.8MB 487ms 0ms rustc 1.87.0
rust 2-m.rs 521ms 0.3ms 2.1MB 2020ms 3ms rustc 1.87.0
haxe 1.hx 984ms 3.3ms 3.1MB 970ms 0ms haxe/hl/c 4.3.6
rust 2.rs 1067ms 0.1ms 2.0MB 1060ms 0ms rustc 1.87.0
haxe 1.hx 2400ms 1.8ms 6.6MB 2390ms 0ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 3.8MB 4990ms 0ms haxe/hl/jit 1.15.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 36ms 0.5ms 2.3MB 110ms 0ms rustc 1.89.0-nightly
rust 7-m.rs 36ms 0.5ms 2.0MB 113ms 0ms rustc 1.87.0
rust 8.rs 65ms 0.5ms 2.0MB 60ms 0ms rustc 1.89.0-nightly
rust 7.rs 125ms 1.2ms 1.9MB 120ms 0ms rustc 1.87.0
rust 2-m.rs 134ms 0.3ms 2.0MB 490ms 0ms rustc 1.87.0
haxe 1.hx 251ms 2.2ms 3.1MB 240ms 0ms haxe/hl/c 4.3.6
rust 2.rs 269ms 0.2ms 1.9MB 260ms 0ms rustc 1.87.0
haxe 1.hx 610ms 11ms 5.4MB 597ms 0ms haxe/cpp 4.3.6
haxe 1.hx 2306ms 10ms 3.8MB 2297ms 0ms haxe/hl/jit 1.15.0

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4.rs 1281ms 3.7ms 33.6MB 1260ms 10ms rustc 1.87.0
haxe 1.hx 1317ms 11ms 144.0MB 1497ms 70ms haxe/cpp 4.3.6
rust 5.rs 1360ms 12ms 33.8MB 1337ms 7ms rustc 1.87.0
rust 3.rs 1485ms 57ms 49.8MB 1453ms 17ms rustc 1.87.0
haxe 2.hx 4420ms 7.8ms 495.1MB 5000ms 247ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 48.6MB 5657ms 417ms haxe/hl/c 4.3.6
haxe 2.hx timeout 0.0ms 83.0MB 5150ms 673ms haxe/hl/c 4.3.6
haxe 1.hx timeout 0.0ms 50.9MB 7683ms 437ms haxe/hl/jit 1.15.0
haxe 2.hx timeout 0.0ms 131.0MB 7317ms 777ms haxe/hl/jit 1.15.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
haxe 1.hx 90ms 3.6ms 25.8MB 83ms 3ms haxe/cpp 4.3.6
rust 4.rs 124ms 2.4ms 5.8MB 113ms 0ms rustc 1.87.0
rust 5.rs 127ms 3.7ms 5.8MB 117ms 0ms rustc 1.87.0
rust 3.rs 138ms 7.0ms 7.8MB 127ms 0ms rustc 1.87.0
haxe 2.hx 398ms 2.4ms 58.3MB 440ms 23ms haxe/cpp 4.3.6
haxe 1.hx 646ms 9.3ms 8.7MB 603ms 60ms haxe/hl/c 4.3.6
haxe 1.hx 692ms 36ms 11.2MB 753ms 53ms haxe/hl/jit 1.15.0
haxe 2.hx 946ms 20ms 25.2MB 910ms 177ms haxe/hl/jit 1.15.0
haxe 2.hx 1045ms 6.8ms 13.7MB 940ms 160ms haxe/hl/c 4.3.6

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-m.rs 529ms 9.1ms 9.1MB 2003ms 57ms rustc 1.87.0
rust 5-m.rs 548ms 114ms 5.5MB 2063ms 63ms rustc 1.87.0
rust 1-m.rs 918ms 4.0ms 7.4MB 3403ms 190ms rustc 1.87.0
rust 3.rs 1104ms 13ms 9.3MB 1063ms 27ms rustc 1.87.0
rust 4.rs 1879ms 5.7ms 6.9MB 1863ms 0ms rustc 1.87.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5-m.rs 52ms 1.9ms 3.3MB 163ms 7ms rustc 1.87.0
rust 3-m.rs 59ms 3.2ms 4.4MB 187ms 10ms rustc 1.87.0
rust 3.rs 67ms 0.4ms 4.0MB 57ms 0ms rustc 1.87.0
rust 1-m.rs 71ms 0.4ms 3.5MB 223ms 20ms rustc 1.87.0
rust 4.rs 118ms 4.8ms 3.1MB 107ms 0ms rustc 1.87.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 121ms 2.3ms 3.6MB 113ms 0ms rustc 1.87.0
rust 2.rs 427ms 1.5ms 3.6MB 417ms 0ms rustc 1.87.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 34ms 1.6ms 2.9MB 30ms 0ms rustc 1.87.0
rust 2.rs 76ms 0.1ms 3.0MB 70ms 0ms rustc 1.87.0

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-im.rs 412ms 1.0ms 2.1MB 1587ms 0ms rustc 1.87.0
rust 5-m.rs 558ms 5.3ms 2.1MB 2150ms 0ms rustc 1.87.0
rust 2-im.rs 666ms 4.7ms 2.0MB 2570ms 0ms rustc 1.87.0
rust 1-m.rs 959ms 43ms 2.1MB 3667ms 0ms rustc 1.87.0
rust 3-i.rs 1498ms 0.7ms 1.8MB 1490ms 0ms rustc 1.87.0
rust 2-i.rs 2345ms 0.3ms 1.8MB 2337ms 0ms rustc 1.87.0
rust 1.rs 2722ms 8.7ms 1.8MB 2713ms 0ms rustc 1.87.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 3-im.rs 38ms 0.4ms 2.0MB 123ms 0ms rustc 1.87.0
rust 5-m.rs 52ms 0.7ms 2.1MB 170ms 0ms rustc 1.87.0
rust 2-im.rs 61ms 2.1ms 2.1MB 207ms 0ms rustc 1.87.0
rust 1-m.rs 82ms 1.9ms 2.1MB 290ms 0ms rustc 1.87.0
rust 3-i.rs 125ms 0.7ms 1.9MB 120ms 0ms rustc 1.87.0
rust 2-i.rs 193ms 0.3ms 1.8MB 183ms 0ms rustc 1.87.0
rust 1.rs 225ms 2.5ms 1.8MB 217ms 0ms rustc 1.87.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5c-m.rs 89ms 0.4ms 3.4MB 260ms 0ms rustc 1.87.0
rust 6.rs 89ms 0.5ms 1.9MB 80ms 0ms rustc 1.87.0
rust 5-m.rs 94ms 0.8ms 3.2MB 293ms 0ms rustc 1.87.0
rust 1c.rs 162ms 0.5ms 1.9MB 150ms 0ms rustc 1.87.0
rust 1.rs 196ms 1.0ms 1.9MB 190ms 0ms rustc 1.87.0
haxe 1.hx 2388ms 16ms 25.6MB 2313ms 200ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 3.2MB 4373ms 853ms haxe/hl/c 4.3.6
haxe 1.hx timeout 0.0ms 3.6MB 4387ms 853ms haxe/hl/jit 1.15.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 6.rs 12ms 1.2ms 1.9MB 10ms 0ms rustc 1.87.0
rust 5c-m.rs 16ms 0.5ms 3.2MB 27ms 0ms rustc 1.87.0
rust 5-m.rs 17ms 0.5ms 3.2MB 30ms 0ms rustc 1.87.0
rust 1c.rs 19ms 0.3ms 1.9MB 10ms 0ms rustc 1.87.0
rust 1.rs 22ms 0.4ms 2.0MB 10ms 0ms rustc 1.87.0
haxe 1.hx 254ms 3.7ms 25.6MB 223ms 27ms haxe/cpp 4.3.6
haxe 1.hx 651ms 2.0ms 3.4MB 553ms 120ms haxe/hl/c 4.3.6
haxe 1.hx 682ms 5.2ms 3.6MB 593ms 110ms haxe/hl/jit 1.15.0

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1-m.rs 265ms 55ms 79.6MB 150ms 480ms rustc 1.87.0
rust 2-http2.rs 318ms 19ms 55.1MB 703ms 357ms rustc 1.87.0
rust 2-m.rs 354ms 23ms 73.1MB 230ms 823ms rustc 1.87.0
rust 1-http2.rs 536ms 57ms 70.0MB 1193ms 697ms rustc 1.87.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1-m.rs 40ms 9.1ms 17.4MB 20ms 53ms rustc 1.87.0
rust 2-m.rs 79ms 2.2ms 22.6MB 33ms 163ms rustc 1.87.0
rust 2-http2.rs 193ms 32ms 25.0MB 483ms 170ms rustc 1.87.0
rust 1-http2.rs 268ms 9.1ms 24.9MB 757ms 200ms rustc 1.87.0

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5-i.rs 30ms 0.9ms 9.8MB 20ms 0ms rustc 1.87.0
rust 4-i.rs 32ms 2.3ms 7.9MB 20ms 0ms rustc 1.87.0
rust 2.rs 62ms 2.5ms 33.8MB 37ms 10ms rustc 1.87.0
rust 3.rs 64ms 2.6ms 32.0MB 43ms 10ms rustc 1.87.0
rust 1.rs 105ms 1.3ms 67.4MB 67ms 27ms rustc 1.87.0

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 5-i.rs 211ms 3.7ms 53.3MB 187ms 13ms rustc 1.87.0
rust 4-i.rs 262ms 4.6ms 54.5MB 207ms 40ms rustc 1.87.0
rust 2.rs 392ms 0.9ms 237.8MB 287ms 93ms rustc 1.87.0
rust 3.rs 405ms 5.0ms 238.1MB 307ms 83ms rustc 1.87.0
rust 1.rs 693ms 3.9ms 551.8MB 440ms 237ms rustc 1.87.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 222ms 6.6ms 28.0MB 630ms 17ms rustc 1.87.0
rust 8.rs 416ms 2.8ms 23.8MB 390ms 10ms rustc 1.87.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 8-m.rs 33ms 2.4ms 16.5MB 67ms 0ms rustc 1.87.0
rust 8.rs 55ms 0.9ms 11.4MB 40ms 3ms rustc 1.87.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 35ms 5.1ms 1.9MB 27ms 0ms rustc 1.87.0
rust 1.rs 49ms 4.1ms 1.9MB 43ms 0ms rustc 1.87.0
haxe 1.hx 135ms 0.8ms 3.0MB 130ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 136ms 2.8ms 20.5MB 120ms 3ms haxe/cpp 4.3.6
haxe 1.hx 159ms 1.5ms 3.8MB 150ms 0ms haxe/hl/jit 1.15.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 143ms 28ms 1.8MB 133ms 0ms rustc 1.87.0
rust 1.rs 175ms 13ms 1.9MB 167ms 0ms rustc 1.87.0
haxe 1.hx 380ms 3.8ms 25.5MB 360ms 7ms haxe/cpp 4.3.6
haxe 1.hx 396ms 1.8ms 3.1MB 387ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 460ms 18ms 3.8MB 450ms 0ms haxe/hl/jit 1.15.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0-unsafe.rs 24ms 2.0ms 1.8MB 17ms 0ms rustc 1.87.0
rust 1.rs 29ms 0.5ms 1.8MB 20ms 0ms rustc 1.87.0
haxe 1.hx 64ms 1.4ms 12.3MB 53ms 0ms haxe/cpp 4.3.6
haxe 1.hx 68ms 1.4ms 3.0MB 60ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 81ms 0.9ms 3.6MB 70ms 0ms haxe/hl/jit 1.15.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 708ms 3.5ms 33.8MB 683ms 10ms rustc 1.87.0
haxe 1.hx 922ms 7.4ms 95.0MB 1027ms 47ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 32.6MB 4987ms 523ms haxe/hl/c 4.3.6
haxe 1.hx timeout 0.0ms 55.1MB 5913ms 467ms haxe/hl/jit 1.15.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 151ms 2.0ms 9.8MB 140ms 0ms rustc 1.87.0
haxe 1.hx 174ms 2.4ms 26.6MB 173ms 13ms haxe/cpp 4.3.6
haxe 1.hx 1325ms 25ms 20.3MB 1353ms 123ms haxe/hl/jit 1.15.0
haxe 1.hx 1377ms 28ms 10.8MB 1313ms 153ms haxe/hl/c 4.3.6

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 317ms 11ms 40.9MB 300ms 0ms rustc 1.87.0
rust 2.rs 318ms 4.7ms 6.6MB 307ms 0ms rustc 1.87.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 60ms 1.5ms 11.6MB 50ms 0ms rustc 1.87.0
rust 2.rs 78ms 0.2ms 2.9MB 70ms 0ms rustc 1.87.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 1525ms 8.2ms 2.7MB 1313ms 190ms rustc 1.87.0
rust 2.rs 1715ms 7.5ms 2.7MB 1627ms 73ms rustc 1.87.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 1.rs 326ms 2.2ms 2.4MB 303ms 7ms rustc 1.87.0
rust 2.rs 382ms 2.7ms 2.4MB 370ms 0ms rustc 1.87.0

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 7.rs 442ms 4.0ms 78.6MB 450ms 17ms rustc 1.87.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 7.rs 51ms 1.5ms 11.6MB 43ms 0ms rustc 1.87.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0.rs 116ms 0.3ms 1.8MB 110ms 0ms rustc 1.87.0
rust 1.rs 1414ms 10ms 1.9MB 1403ms 0ms rustc 1.87.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 0.rs 32ms 1.5ms 1.9MB 23ms 0ms rustc 1.87.0
rust 1.rs 359ms 5.0ms 1.9MB 350ms 0ms rustc 1.87.0