Odin VS C# benchmarks

Current benchmark data was generated on Sun Jan 29 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -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 1241ms 50ms 383.8MB 1153ms 187ms dotnet/aot 7.0.102
csharp 1.cs 1523ms 25ms 473.5MB 1337ms 230ms dotnet 7.0.102
csharp 1.cs 2191ms 3.7ms 98.5MB 2523ms 157ms mono 6.12.0
odin 1.odin 4186ms 20ms 49.5MB 4153ms 17ms odin 2023

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 125ms 1.7ms 72.0MB 103ms 20ms dotnet/aot 7.0.102
csharp 1.cs 154ms 0.5ms 48.1MB 133ms 13ms mono 6.12.0
csharp 1.cs 255ms 5.7ms 168.2MB 180ms 53ms dotnet 7.0.102
odin 1.odin 383ms 0.8ms 7.4MB 370ms 0ms odin 2023

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 1.6ms 0.6ms 1.3MB 0ms 0ms odin 2023
csharp 1.cs 5.7ms 0.6ms 10.1MB 0ms 0ms dotnet/aot 7.0.102
csharp 1.cs 19ms 0.7ms 23.6MB 10ms 0ms mono 6.12.0
csharp 1.cs 75ms 3.4ms 101.5MB 20ms 20ms dotnet 7.0.102

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1-m.odin 845ms 5.5ms 46.0MB 1473ms 43ms odin 2023
csharp 6-m.cs 949ms 4.6ms 55.7MB 1473ms 27ms dotnet/aot 7.0.102
csharp 6-m.cs 1221ms 45ms 144.2MB 1960ms 47ms dotnet 7.0.102
csharp 6-m.cs 1658ms 166ms 71.3MB 2560ms 20ms mono 6.12.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 6.cs 150ms 4.7ms 41.9MB 187ms 10ms dotnet/aot 7.0.102
odin 1.odin 171ms 7.2ms 31.7MB 227ms 20ms odin 2023
csharp 6.cs 237ms 12ms 53.0MB 303ms 23ms mono 6.12.0
csharp 6.cs 279ms 4.6ms 134.3MB 287ms 47ms dotnet 7.0.102

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 137ms 1.0ms 10.1MB 133ms 0ms dotnet/aot 7.0.102
csharp 2.cs 186ms 0.6ms 25.1MB 170ms 0ms mono 6.12.0
csharp 2.cs 218ms 0.2ms 104.0MB 173ms 20ms dotnet 7.0.102
odin 1.odin 270ms 1.5ms 1.3MB 260ms 0ms odin 2023
csharp 1.cs 1292ms 3.5ms 73.4MB 1280ms 13ms dotnet/aot 7.0.102
csharp 1.cs 1726ms 77ms 161.5MB 1663ms 47ms dotnet 7.0.102
csharp 1.cs 3013ms 1.1ms 49.5MB 2973ms 30ms mono 6.12.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 399ms 3.6ms 10.2MB 390ms 0ms dotnet/aot 7.0.102
csharp 2.cs 437ms 2.9ms 102.1MB 387ms 20ms dotnet 7.0.102
csharp 2.cs 505ms 4.5ms 25.5MB 493ms 0ms mono 6.12.0
odin 1.odin 815ms 2.7ms 1.2MB 810ms 0ms odin 2023
csharp 1.cs 3853ms 86ms 76.0MB 3820ms 33ms dotnet/aot 7.0.102
csharp 1.cs 4637ms 55ms 164.4MB 4577ms 43ms dotnet 7.0.102
csharp 1.cs timeout 0.0ms 47.8MB 4957ms 37ms mono 6.12.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 72ms 2.1ms 10.0MB 70ms 0ms dotnet/aot 7.0.102
csharp 2.cs 106ms 0.5ms 25.3MB 90ms 3ms mono 6.12.0
odin 1.odin 113ms 2.0ms 1.3MB 103ms 0ms odin 2023
csharp 2.cs 152ms 3.6ms 103.8MB 103ms 17ms dotnet 7.0.102
csharp 1.cs 2821ms 6.3ms 62.7MB 2793ms 17ms dotnet/aot 7.0.102
csharp 1.cs 3077ms 49ms 152.5MB 2997ms 57ms dotnet 7.0.102
csharp 1.cs 3184ms 3.0ms 31.4MB 3170ms 0ms mono 6.12.0

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 743ms 8.9ms 164.9MB 663ms 53ms dotnet 7.0.102
odin 1.odin 1586ms 3.3ms 4.5MB 1573ms 0ms odin 2023
csharp 3.cs 3636ms 52ms 112.0MB 3583ms 23ms dotnet 7.0.102
csharp 1.cs 4032ms 70ms 107.8MB 3960ms 17ms dotnet 7.0.102
csharp 3.cs 4533ms 14ms 15.9MB 4530ms 0ms dotnet/aot 7.0.102
csharp 1.cs timeout 0.0ms 14.4MB 4990ms 0ms dotnet/aot 7.0.102
csharp 1.cs timeout 0.0ms 26.8MB 4983ms 0ms mono 6.12.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 95ms 46ms 1.3MB 83ms 0ms odin 2023
csharp 2.cs 143ms 6.1ms 111.6MB 100ms 17ms dotnet 7.0.102
csharp 3.cs 195ms 3.2ms 15.1MB 190ms 0ms dotnet/aot 7.0.102
csharp 1.cs 236ms 9.3ms 13.0MB 230ms 0ms dotnet/aot 7.0.102
csharp 1.cs 248ms 1.8ms 106.1MB 197ms 17ms dotnet 7.0.102
csharp 3.cs 251ms 2.9ms 108.6MB 203ms 17ms dotnet 7.0.102
csharp 1.cs 836ms 6.0ms 28.7MB 820ms 0ms mono 6.12.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 9.cs 431ms 4.2ms 102.5MB 383ms 17ms dotnet 7.0.102
csharp 8.cs 495ms 0.3ms 12.0MB 493ms 0ms dotnet/aot 7.0.102
odin 1-i.odin 533ms 6.0ms 1.2MB 523ms 0ms odin 2023
csharp 8.cs 554ms 3.4ms 97.9MB 503ms 27ms dotnet 7.0.102
csharp 8.cs 1136ms 44ms 24.3MB 1120ms 3ms mono 6.12.0
odin 1.odin 2879ms 0.3ms 1.3MB 2870ms 0ms odin 2023

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1-i.odin 55ms 0.6ms 1.3MB 43ms 0ms odin 2023
csharp 8.cs 58ms 1.4ms 8.0MB 57ms 0ms dotnet/aot 7.0.102
csharp 9.cs 122ms 3.6ms 100.5MB 73ms 17ms dotnet 7.0.102
csharp 8.cs 129ms 2.1ms 100.2MB 83ms 17ms dotnet 7.0.102
csharp 8.cs 133ms 1.4ms 25.1MB 117ms 3ms mono 6.12.0
odin 1.odin 292ms 3.4ms 1.2MB 280ms 0ms odin 2023

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 600ms 8.2ms 40.6MB 573ms 10ms odin 2023
csharp 2.cs 772ms 9.8ms 21.9MB 760ms 0ms dotnet/aot 7.0.102
csharp 1.cs 850ms 17ms 71.9MB 827ms 17ms dotnet/aot 7.0.102
csharp 1.cs 868ms 21ms 88.4MB 840ms 13ms mono 6.12.0
csharp 2.cs 954ms 1.4ms 109.4MB 907ms 17ms dotnet 7.0.102
odin 2.odin 1181ms 0.7ms 6.4MB 1167ms 0ms odin 2023
csharp 1.cs 1390ms 21ms 157.1MB 1327ms 33ms dotnet 7.0.102
csharp 2.cs 2463ms 28ms 32.3MB 2450ms 0ms mono 6.12.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
odin 1.odin 123ms 3.7ms 11.4MB 107ms 0ms odin 2023
csharp 1.cs 138ms 5.1ms 29.9MB 137ms 0ms dotnet/aot 7.0.102
csharp 1.cs 183ms 1.5ms 42.5MB 160ms 7ms mono 6.12.0
csharp 2.cs 192ms 2.1ms 15.1MB 187ms 0ms dotnet/aot 7.0.102
csharp 2.cs 289ms 4.7ms 104.7MB 243ms 17ms dotnet 7.0.102
odin 2.odin 290ms 3.0ms 2.6MB 280ms 0ms odin 2023
csharp 1.cs 348ms 2.4ms 114.8MB 303ms 17ms dotnet 7.0.102
csharp 2.cs 605ms 2.9ms 25.6MB 590ms 0ms mono 6.12.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 2567ms 42ms 13.8MB 4943ms 3ms dotnet/aot 7.0.102
csharp 3-m.cs 4480ms 103ms 103.0MB 8387ms 27ms dotnet 7.0.102
odin 1.odin 4617ms 1.1ms 2.9MB 4607ms 0ms odin 2023
csharp 3.cs timeout 0.0ms 31.1MB 9770ms 7ms mono 6.12.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 650ms 2.9ms 12.1MB 1230ms 10ms dotnet/aot 7.0.102
odin 1.odin 1157ms 0.7ms 2.1MB 1147ms 0ms odin 2023
csharp 3.cs 1434ms 228ms 104.6MB 2077ms 27ms dotnet 7.0.102
csharp 3-m.cs 3100ms 4.6ms 29.8MB 6033ms 10ms mono 6.12.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 182ms 1.4ms 12.4MB 317ms 3ms dotnet/aot 7.0.102
odin 1.odin 291ms 0.4ms 1.8MB 280ms 0ms odin 2023
csharp 3-m.cs 403ms 1.5ms 104.2MB 633ms 27ms dotnet 7.0.102
csharp 3-m.cs 887ms 148ms 29.4MB 1523ms 3ms mono 6.12.0