Haxe VS C# benchmarks

Current benchmark data was generated on Mon Dec 30 2024, 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
csharp 1.cs 934ms 19ms 178.8MB 943ms 113ms dotnet/aot 9.0.101
csharp 1.cs 937ms 13ms 190.1MB 943ms 147ms dotnet 9.0.101
haxe 1.hx 1335ms 42ms 145.9MB 1523ms 70ms haxe/cpp 4.3.6
csharp 1.cs 1755ms 97ms 101.4MB 1977ms 223ms mono 6.12.0
haxe 2.hx 4428ms 63ms 497.1MB 5017ms 250ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 50.6MB 5383ms 433ms haxe/hl/c 4.3.6
haxe 2.hx timeout 0.0ms 85.0MB 4953ms 717ms haxe/hl/c 4.3.6
haxe 1.hx timeout 0.0ms 53.1MB 7477ms 390ms haxe/hl/jit 1.14.0
haxe 2.hx timeout 0.0ms 132.9MB 7453ms 820ms haxe/hl/jit 1.14.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
haxe 1.hx 86ms 1.8ms 27.6MB 70ms 10ms haxe/cpp 4.3.6
csharp 1.cs 116ms 6.0ms 40.9MB 90ms 20ms dotnet/aot 9.0.101
csharp 1.cs 145ms 4.8ms 46.0MB 123ms 13ms mono 6.12.0
csharp 1.cs 202ms 19ms 61.8MB 153ms 33ms dotnet 9.0.101
haxe 2.hx 388ms 6.7ms 58.3MB 420ms 23ms haxe/cpp 4.3.6
haxe 1.hx 628ms 2.2ms 10.9MB 583ms 60ms haxe/hl/c 4.3.6
haxe 1.hx 666ms 4.0ms 13.2MB 727ms 43ms haxe/hl/jit 1.14.0
haxe 2.hx 915ms 13ms 15.5MB 837ms 127ms haxe/hl/c 4.3.6
haxe 2.hx 953ms 19ms 27.2MB 893ms 183ms haxe/hl/jit 1.14.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 128ms 5.1ms 32.6MB 353ms 83ms dotnet/aot 9.0.101
csharp 5-m.cs 200ms 2.9ms 49.2MB 467ms 120ms dotnet 9.0.101
csharp 5-m.cs 254ms 11ms 60.7MB 697ms 107ms mono 6.12.0
haxe 1.hx 2430ms 12ms 27.6MB 2263ms 247ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 5.2MB 4253ms 950ms haxe/hl/c 4.3.6
haxe 1.hx timeout 0.0ms 5.7MB 4350ms 877ms haxe/hl/jit 1.14.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 27ms 1.0ms 25.2MB 37ms 17ms dotnet/aot 9.0.101
csharp 5-m.cs 64ms 4.7ms 46.9MB 83ms 20ms dotnet 9.0.101
csharp 5-m.cs 72ms 4.0ms 42.9MB 103ms 23ms mono 6.12.0
haxe 1.hx 258ms 1.6ms 25.5MB 223ms 30ms haxe/cpp 4.3.6
haxe 1.hx 651ms 2.0ms 5.4MB 543ms 123ms haxe/hl/c 4.3.6
haxe 1.hx 690ms 5.2ms 5.7MB 577ms 127ms haxe/hl/jit 1.14.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
haxe 1.hx 2.2ms 0.2ms 4.9MB 0ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 2.3ms 0.2ms 4.4MB 0ms 0ms haxe/cpp 4.3.6
haxe 1.hx 3.8ms 0.4ms 5.3MB 0ms 0ms haxe/hl/jit 1.14.0
csharp 1.cs 11ms 8.6ms 15.6MB 0ms 0ms dotnet/aot 9.0.101
csharp 1.cs 30ms 0.6ms 21.9MB 16ms 2ms mono 6.12.0
csharp 1.cs 36ms 0.9ms 32.0MB 16ms 12ms dotnet 9.0.101

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 95ms 1.0ms 13.8MB 80ms 3ms dotnet/aot 9.0.101
haxe 1.hx 132ms 0.1ms 20.5MB 117ms 3ms haxe/cpp 4.3.6
haxe 1.hx 135ms 2.0ms 5.2MB 123ms 0ms haxe/hl/c 4.3.6
csharp 2.cs 147ms 2.3ms 24.5MB 133ms 0ms mono 6.12.0
haxe 1.hx 157ms 2.0ms 5.8MB 147ms 0ms haxe/hl/jit 1.14.0
csharp 2.cs 250ms 1.2ms 33.4MB 233ms 10ms dotnet 9.0.101
csharp 1.cs 1062ms 6.0ms 15.0MB 1037ms 10ms dotnet/aot 9.0.101
csharp 1.cs 1358ms 84ms 36.9MB 1343ms 20ms dotnet 9.0.101
csharp 1.cs 3290ms 18ms 47.6MB 3247ms 37ms mono 6.12.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 263ms 0.8ms 11.7MB 250ms 0ms dotnet/aot 9.0.101
csharp 2.cs 362ms 9.5ms 24.8MB 347ms 3ms mono 6.12.0
haxe 1.hx 374ms 2.7ms 25.5MB 363ms 0ms haxe/cpp 4.3.6
haxe 1.hx 394ms 2.7ms 5.0MB 377ms 0ms haxe/hl/c 4.3.6
csharp 2.cs 407ms 3.9ms 35.6MB 393ms 7ms dotnet 9.0.101
haxe 1.hx 455ms 3.5ms 5.8MB 440ms 3ms haxe/hl/jit 1.14.0
csharp 1.cs 3145ms 6.5ms 17.2MB 3117ms 13ms dotnet/aot 9.0.101
csharp 1.cs 3577ms 12ms 39.1MB 3560ms 23ms dotnet 9.0.101
csharp 1.cs timeout 0.0ms 47.6MB 4937ms 53ms mono 6.12.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 53ms 0.9ms 15.7MB 43ms 0ms dotnet/aot 9.0.101
haxe 1.hx 63ms 1.4ms 12.4MB 53ms 0ms haxe/cpp 4.3.6
haxe 1.hx 68ms 1.0ms 5.1MB 60ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 79ms 1.9ms 5.7MB 67ms 0ms haxe/hl/jit 1.14.0
csharp 2.cs 93ms 3.1ms 22.8MB 83ms 0ms mono 6.12.0
csharp 2.cs 174ms 5.4ms 35.3MB 150ms 7ms dotnet 9.0.101
csharp 1.cs 1612ms 13ms 36.4MB 1597ms 13ms dotnet 9.0.101
csharp 1.cs 1800ms 3.3ms 16.9MB 1780ms 3ms dotnet/aot 9.0.101
csharp 1.cs 1808ms 4.2ms 30.8MB 1797ms 0ms mono 6.12.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 540ms 2.8ms 123.4MB 457ms 110ms dotnet/aot 9.0.101
csharp 1.cs 592ms 9.8ms 152.5MB 530ms 120ms dotnet/aot 9.0.101
csharp 2.cs 680ms 21ms 142.0MB 610ms 117ms dotnet 9.0.101
csharp 1.cs 743ms 44ms 170.9MB 660ms 140ms dotnet 9.0.101
haxe 1.hx 881ms 7.2ms 96.9MB 980ms 40ms haxe/cpp 4.3.6
csharp 1.cs 1301ms 44ms 146.2MB 1470ms 203ms mono 6.12.0
haxe 1.hx timeout 0.0ms 34.6MB 4763ms 560ms haxe/hl/c 4.3.6
haxe 1.hx timeout 0.0ms 59.7MB 6013ms 470ms haxe/hl/jit 1.14.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 135ms 1.9ms 64.9MB 100ms 37ms dotnet/aot 9.0.101
csharp 1.cs 154ms 4.0ms 78.9MB 110ms 57ms dotnet/aot 9.0.101
haxe 1.hx 162ms 1.4ms 26.6MB 163ms 3ms haxe/cpp 4.3.6
csharp 2.cs 258ms 2.7ms 83.9MB 217ms 43ms dotnet 9.0.101
csharp 1.cs 265ms 1.4ms 73.2MB 223ms 47ms mono 6.12.0
csharp 1.cs 278ms 7.3ms 101.3MB 237ms 57ms dotnet 9.0.101
haxe 1.hx 1282ms 5.4ms 12.7MB 1217ms 137ms haxe/hl/c 4.3.6
haxe 1.hx 1301ms 8.1ms 22.3MB 1310ms 130ms haxe/hl/jit 1.14.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 9.cs 359ms 1.6ms 34.0MB 337ms 7ms dotnet 9.0.101
csharp 8.cs 373ms 3.9ms 15.7MB 357ms 0ms dotnet/aot 9.0.101
csharp 8.cs 426ms 13ms 33.8MB 390ms 13ms dotnet 9.0.101
haxe 2.hx 853ms 4.3ms 5.0MB 843ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 1056ms 20ms 5.0MB 1047ms 0ms haxe/hl/c 4.3.6
csharp 8.cs 1248ms 3.3ms 24.1MB 1237ms 0ms mono 6.12.0
haxe 3.hx 1383ms 5.0ms 27.5MB 1513ms 37ms haxe/cpp 4.3.6
haxe 2.hx 2402ms 1.6ms 5.8MB 2390ms 0ms haxe/hl/jit 1.14.0
haxe 1.hx 2449ms 4.0ms 5.8MB 2437ms 0ms haxe/hl/jit 1.14.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 5.3MB 3917ms 1587ms haxe/hl/c 4.3.6
haxe 3.hx timeout 0.0ms 6.0MB 4130ms 1333ms haxe/hl/jit 1.14.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 8.cs 46ms 0.6ms 15.9MB 33ms 0ms dotnet/aot 9.0.101
haxe 2.hx 89ms 1.1ms 5.0MB 80ms 0ms haxe/hl/c 4.3.6
csharp 9.cs 91ms 0.7ms 33.8MB 70ms 10ms dotnet 9.0.101
csharp 8.cs 104ms 17ms 33.7MB 73ms 7ms dotnet 9.0.101
haxe 1.hx 109ms 1.4ms 5.0MB 100ms 0ms haxe/hl/c 4.3.6
haxe 3.hx 153ms 1.0ms 25.6MB 147ms 13ms haxe/cpp 4.3.6
csharp 8.cs 161ms 1.4ms 22.5MB 147ms 3ms mono 6.12.0
haxe 2.hx 244ms 0.6ms 5.8MB 230ms 0ms haxe/hl/jit 1.14.0
haxe 1.hx 251ms 2.9ms 5.7MB 240ms 0ms haxe/hl/jit 1.14.0
haxe 3.hx 662ms 6.0ms 5.3MB 483ms 237ms haxe/hl/c 4.3.6
haxe 2.hx 675ms 7.4ms 4.4MB 663ms 0ms haxe/cpp 4.3.6
haxe 3.hx 772ms 2.9ms 5.8MB 617ms 210ms haxe/hl/jit 1.14.0
haxe 1.hx 805ms 6.0ms 4.4MB 793ms 0ms haxe/cpp 4.3.6

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 1858ms 0.9ms 18.2MB 7250ms 10ms dotnet/aot 9.0.101
csharp 3-m.cs 2189ms 252ms 38.0MB 6870ms 10ms dotnet 9.0.101
haxe 1.hx 3909ms 15ms 5.3MB 3897ms 0ms haxe/hl/c 4.3.6
csharp 3-m.cs 4588ms 37ms 28.7MB 17757ms 13ms mono 6.12.0
haxe 1.hx timeout 0.0ms 6.9MB 4990ms 0ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 5.8MB 4990ms 0ms haxe/hl/jit 1.14.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 476ms 1.0ms 18.3MB 1810ms 7ms dotnet/aot 9.0.101
csharp 3-m.cs 530ms 2.0ms 37.9MB 1857ms 17ms dotnet 9.0.101
haxe 1.hx 985ms 4.9ms 5.1MB 970ms 0ms haxe/hl/c 4.3.6
csharp 3-m.cs 1305ms 182ms 34.4MB 4597ms 17ms mono 6.12.0
haxe 1.hx 2388ms 1.9ms 6.5MB 2380ms 0ms haxe/cpp 4.3.6
haxe 1.hx timeout 0.0ms 5.7MB 4990ms 0ms haxe/hl/jit 1.14.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 129ms 1.1ms 18.5MB 443ms 7ms dotnet/aot 9.0.101
csharp 3-m.cs 179ms 1.4ms 36.5MB 507ms 0ms dotnet 9.0.101
haxe 1.hx 251ms 2.3ms 5.0MB 240ms 0ms haxe/hl/c 4.3.6
csharp 3-m.cs 355ms 13ms 30.3MB 1183ms 10ms mono 6.12.0
haxe 1.hx 602ms 1.2ms 5.3MB 590ms 0ms haxe/cpp 4.3.6
haxe 1.hx 2298ms 16ms 5.8MB 2287ms 0ms haxe/hl/jit 1.14.0