C# VS Codon 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

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

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1-m.cs 4497ms 43ms 178.9MB 7500ms 77ms dotnet 7.0.102
csharp 1.cs timeout 0.0ms 81.1MB 9297ms 47ms dotnet/aot 7.0.102

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1-m.cs 344ms 13ms 66.2MB 570ms 30ms dotnet/aot 7.0.102
csharp 1-m.cs 583ms 43ms 158.6MB 903ms 47ms dotnet 7.0.102

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs timeout 0.0ms 111.6MB 4953ms 30ms dotnet 7.0.102
csharp 1.cs timeout 0.0ms 22.8MB 4987ms 3ms dotnet/aot 7.0.102

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 1019ms 11ms 19.1MB 1013ms 0ms dotnet/aot 7.0.102
csharp 1.cs 1121ms 4.6ms 109.5MB 1067ms 20ms dotnet 7.0.102

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 365ms 37ms 71.5MB 553ms 137ms dotnet/aot 7.0.102
csharp 5-m.cs 494ms 36ms 85.9MB 830ms 93ms mono 6.12.0
csharp 5-m.cs 636ms 73ms 161.9MB 1030ms 133ms dotnet 7.0.102

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5.cs 58ms 7.1ms 24.7MB 73ms 10ms dotnet/aot 7.0.102
csharp 5.cs 97ms 14ms 37.8MB 113ms 30ms mono 6.12.0
csharp 5.cs 127ms 16ms 109.3MB 120ms 40ms dotnet 7.0.102

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
codon 1.py 4.1ms 0.8ms 5.3MB 0ms 0ms codon 0.15.4
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

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 905ms 33ms 234.0MB 800ms 423ms dotnet 7.0.102
csharp 2-http2.cs 939ms 10ms 204.3MB 967ms 130ms dotnet 7.0.102
csharp 1-m.cs 988ms 24ms 247.7MB 1017ms 470ms dotnet 7.0.102
csharp 2-http3.cs 1323ms 64ms 267.4MB 1533ms 273ms dotnet 7.0.102

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 508ms 11ms 159.1MB 397ms 130ms dotnet 7.0.102
csharp 1.cs 555ms 12ms 165.9MB 507ms 167ms dotnet 7.0.102
csharp 2-http2.cs 818ms 4.1ms 164.1MB 777ms 83ms dotnet 7.0.102
csharp 2-http3.cs 895ms 16ms 178.0MB 877ms 123ms dotnet 7.0.102

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 432ms 13ms 146.9MB 363ms 40ms dotnet 7.0.102
csharp 1.cs 700ms 2.3ms 217.9MB 670ms 83ms dotnet 7.0.102

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 1869ms 104ms 337.3MB 1913ms 133ms dotnet 7.0.102
csharp 1.cs 2929ms 15ms 857.7MB 2847ms 397ms dotnet 7.0.102

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
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
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
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
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
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
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
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

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 786ms 7.0ms 362.7MB 683ms 147ms dotnet/aot 7.0.102
csharp 1.cs 842ms 1.2ms 379.9MB 727ms 163ms dotnet/aot 7.0.102
csharp 2.cs 1019ms 3.2ms 468.0MB 840ms 190ms dotnet 7.0.102
csharp 1.cs 1066ms 8.0ms 510.7MB 857ms 230ms dotnet 7.0.102
csharp 1.cs 1697ms 30ms 143.8MB 1993ms 157ms mono 6.12.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 159ms 1.9ms 70.7MB 127ms 30ms dotnet/aot 7.0.102
csharp 1.cs 224ms 9.9ms 199.5MB 147ms 70ms dotnet/aot 7.0.102
csharp 1.cs 305ms 1.9ms 74.1MB 280ms 30ms mono 6.12.0
csharp 1.cs 366ms 4.2ms 270.8MB 250ms 93ms dotnet 7.0.102
csharp 2.cs 389ms 1.3ms 172.5MB 333ms 43ms dotnet 7.0.102

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
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
codon 1.py 1947ms 23ms 5.3MB 1933ms 0ms codon 0.15.4

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
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
codon 1.py 197ms 0.8ms 5.3MB 187ms 0ms codon 0.15.4

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
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
codon 1.py 873ms 79ms 48.3MB 850ms 3ms codon 0.15.4
csharp 2.cs 954ms 1.4ms 109.4MB 907ms 17ms dotnet 7.0.102
codon 2.py 1003ms 24ms 106.7MB 977ms 13ms codon 0.15.4
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
csharp 1.cs 138ms 5.1ms 29.9MB 137ms 0ms dotnet/aot 7.0.102
codon 1.py 150ms 0.2ms 15.1MB 133ms 3ms codon 0.15.4
csharp 1.cs 183ms 1.5ms 42.5MB 160ms 7ms mono 6.12.0
codon 2.py 185ms 3.8ms 23.9MB 173ms 3ms codon 0.15.4
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
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

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 4502ms 7.1ms 76.2MB 4477ms 30ms dotnet/aot 7.0.102
csharp 1.cs 4744ms 13ms 169.7MB 4663ms 110ms dotnet 7.0.102

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 1070ms 1.7ms 73.7MB 1047ms 17ms dotnet/aot 7.0.102
csharp 1.cs 1186ms 12ms 163.7MB 1173ms 37ms dotnet 7.0.102

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5.cs 3374ms 53ms 597.8MB 3310ms 180ms dotnet 7.0.102
csharp 6.cs 3617ms 15ms 499.9MB 3483ms 180ms dotnet/aot 7.0.102
csharp 6.cs 3888ms 43ms 595.3MB 3763ms 170ms dotnet 7.0.102
csharp 5.cs timeout 0.0ms 181.2MB 4973ms 73ms dotnet/aot 7.0.102

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 6.cs 383ms 2.1ms 69.7MB 357ms 23ms dotnet/aot 7.0.102
csharp 5.cs 485ms 6.2ms 166.8MB 437ms 27ms dotnet 7.0.102
csharp 6.cs 577ms 2.7ms 163.9MB 513ms 40ms dotnet 7.0.102
csharp 5.cs 693ms 3.1ms 74.0MB 667ms 23ms dotnet/aot 7.0.102

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 3849ms 9.5ms 73.4MB 3813ms 27ms dotnet/aot 7.0.102
csharp 1.cs 4216ms 39ms 168.1MB 4163ms 67ms dotnet 7.0.102

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 991ms 3.9ms 73.4MB 957ms 30ms dotnet/aot 7.0.102
csharp 1.cs 1183ms 9.5ms 162.9MB 1160ms 60ms dotnet 7.0.102

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
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
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
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