All C# benchmarks

Current benchmark data was generated on Wed Mar 22 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

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 1297ms 66ms 380.8MB 1207ms 193ms dotnet/aot 7.0.202
1.cs 1578ms 7.1ms 413.8MB 1423ms 217ms dotnet 7.0.202
1.cs 2262ms 23ms 108.8MB 2567ms 187ms mono 6.12.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 134ms 4.5ms 75.1MB 103ms 23ms dotnet/aot 7.0.202
1.cs 157ms 3.0ms 44.1MB 133ms 7ms mono 6.12.0
1.cs 241ms 5.6ms 96.3MB 173ms 50ms dotnet 7.0.202

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.cs 4541ms 248ms 104.1MB 7837ms 77ms dotnet 7.0.202
1.cs timeout 0.0ms 84.3MB 9297ms 63ms dotnet/aot 7.0.202

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.cs 374ms 10ms 66.5MB 597ms 40ms dotnet/aot 7.0.202
1.cs 557ms 41ms 84.3MB 747ms 47ms dotnet 7.0.202

edigits

Input: 250001

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs timeout 0.0ms 39.4MB 4973ms 7ms dotnet 7.0.202
1.cs timeout 0.0ms 22.8MB 4983ms 7ms dotnet/aot 7.0.202

Input: 100000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 1029ms 2.7ms 17.1MB 1023ms 0ms dotnet/aot 7.0.202
1.cs 1106ms 9.3ms 37.0MB 1060ms 17ms dotnet 7.0.202

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
5-m.cs 337ms 40ms 51.7MB 543ms 83ms dotnet/aot 7.0.202
5-m.cs 486ms 11ms 38.3MB 853ms 57ms mono 6.12.0
5.cs 619ms 42ms 70.8MB 767ms 113ms dotnet 7.0.202

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
5-m.cs 60ms 8.1ms 26.4MB 67ms 27ms dotnet/aot 7.0.202
5.cs 85ms 2.4ms 35.5MB 100ms 23ms mono 6.12.0
5.cs 110ms 7.0ms 37.4MB 107ms 27ms dotnet 7.0.202

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 6.7ms 1.1ms 12.1MB 0ms 0ms dotnet/aot 7.0.202
1.cs 20ms 1.0ms 23.7MB 10ms 0ms mono 6.12.0
1.cs 62ms 2.2ms 28.7MB 30ms 0ms dotnet 7.0.202

http-server

Input: 3000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 924ms 32ms 163.2MB 873ms 420ms dotnet 7.0.202
2-http2.cs 932ms 17ms 137.9MB 993ms 93ms dotnet 7.0.202
1-m.cs 1023ms 11ms 176.2MB 1057ms 487ms dotnet 7.0.202
2-http3.cs 1371ms 47ms 185.2MB 1600ms 257ms dotnet 7.0.202

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 492ms 8.2ms 81.5MB 400ms 127ms dotnet 7.0.202
1.cs 680ms 42ms 96.5MB 547ms 117ms dotnet 7.0.202
2-http2.cs 850ms 39ms 90.0MB 817ms 90ms dotnet 7.0.202
2-http3.cs 907ms 4.0ms 105.9MB 917ms 117ms dotnet 7.0.202

json-serde

Input: sample 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 427ms 2.1ms 72.4MB 357ms 30ms dotnet 7.0.202
1.cs 685ms 8.2ms 141.0MB 683ms 63ms dotnet 7.0.202

Input: canada 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 1828ms 28ms 268.7MB 1947ms 110ms dotnet 7.0.202
1.cs 3001ms 50ms 784.8MB 2943ms 373ms dotnet 7.0.202

knucleotide

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
6.cs 982ms 7.8ms 51.1MB 1437ms 13ms dotnet/aot 7.0.202
6-m.cs 1580ms 5.4ms 69.6MB 2533ms 20ms mono 6.12.0
6-m.cs 3827ms 35ms 73.3MB 7343ms 30ms dotnet 7.0.202

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
6.cs 157ms 6.0ms 40.8MB 177ms 20ms dotnet/aot 7.0.202
6.cs 252ms 13ms 52.6MB 327ms 17ms mono 6.12.0
6-m.cs 496ms 40ms 62.4MB 763ms 33ms dotnet 7.0.202

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 139ms 5.0ms 10.0MB 137ms 0ms dotnet/aot 7.0.202
2.cs 187ms 0.2ms 25.2MB 170ms 0ms mono 6.12.0
2.cs 202ms 2.4ms 29.3MB 170ms 3ms dotnet 7.0.202
1.cs 1304ms 0.2ms 66.7MB 1273ms 27ms dotnet/aot 7.0.202
1.cs 1659ms 4.0ms 88.8MB 1593ms 47ms dotnet 7.0.202
1.cs 3028ms 9.5ms 47.4MB 2987ms 27ms mono 6.12.0

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 394ms 2.5ms 10.2MB 390ms 0ms dotnet/aot 7.0.202
2.cs 414ms 4.4ms 29.5MB 383ms 7ms dotnet 7.0.202
2.cs 514ms 15ms 25.7MB 493ms 10ms mono 6.12.0
1.cs 3844ms 3.5ms 71.7MB 3800ms 43ms dotnet/aot 7.0.202
1.cs 4659ms 9.0ms 90.2MB 4617ms 30ms dotnet 7.0.202
1.cs timeout 0.0ms 49.7MB 4937ms 57ms mono 6.12.0

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 73ms 0.9ms 10.2MB 67ms 0ms dotnet/aot 7.0.202
2.cs 106ms 0.8ms 25.2MB 90ms 3ms mono 6.12.0
2.cs 135ms 4.0ms 31.2MB 100ms 3ms dotnet 7.0.202
1.cs 2848ms 3.3ms 62.5MB 2823ms 17ms dotnet/aot 7.0.202
1.cs 3093ms 6.9ms 78.0MB 3033ms 30ms dotnet 7.0.202
1.cs 3196ms 15ms 31.3MB 3177ms 0ms mono 6.12.0

mandelbrot

Input: 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 729ms 9.0ms 94.6MB 670ms 33ms dotnet 7.0.202
3.cs 3637ms 74ms 39.1MB 3573ms 10ms dotnet 7.0.202
1.cs 4007ms 11ms 34.6MB 3950ms 3ms dotnet 7.0.202
3.cs 4165ms 27ms 17.6MB 4157ms 0ms dotnet/aot 7.0.202
1.cs timeout 0.0ms 16.2MB 4993ms 0ms dotnet/aot 7.0.202
1.cs timeout 0.0ms 26.9MB 4983ms 0ms mono 6.12.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 125ms 10ms 39.0MB 83ms 10ms dotnet 7.0.202
3.cs 180ms 1.2ms 12.1MB 173ms 0ms dotnet/aot 7.0.202
1.cs 223ms 2.0ms 16.8MB 220ms 0ms dotnet/aot 7.0.202
3.cs 231ms 2.6ms 32.0MB 193ms 10ms dotnet 7.0.202
1.cs 232ms 5.8ms 35.8MB 193ms 7ms dotnet 7.0.202
1.cs 833ms 1.0ms 26.2MB 817ms 3ms mono 6.12.0

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 797ms 1.4ms 368.9MB 687ms 157ms dotnet/aot 7.0.202
1.cs 860ms 6.3ms 384.1MB 760ms 150ms dotnet/aot 7.0.202
2.cs 1005ms 6.1ms 393.8MB 830ms 183ms dotnet 7.0.202
1.cs 1088ms 2.8ms 436.8MB 907ms 193ms dotnet 7.0.202
1.cs 1774ms 69ms 141.3MB 2140ms 137ms mono 6.12.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 163ms 3.3ms 75.5MB 140ms 23ms dotnet/aot 7.0.202
1.cs 235ms 9.0ms 199.5MB 147ms 80ms dotnet/aot 7.0.202
1.cs 330ms 17ms 72.1MB 317ms 23ms mono 6.12.0
1.cs 356ms 0.6ms 200.9MB 250ms 87ms dotnet 7.0.202
2.cs 373ms 1.9ms 100.0MB 327ms 30ms dotnet 7.0.202

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
9.cs 413ms 0.5ms 27.4MB 380ms 7ms dotnet 7.0.202
8.cs 495ms 0.9ms 14.2MB 497ms 0ms dotnet/aot 7.0.202
8.cs 534ms 5.1ms 25.9MB 507ms 3ms dotnet 7.0.202
8.cs 1113ms 6.3ms 24.4MB 1097ms 0ms mono 6.12.0

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
8.cs 57ms 0.8ms 12.1MB 53ms 0ms dotnet/aot 7.0.202
9.cs 106ms 0.8ms 29.7MB 70ms 3ms dotnet 7.0.202
8.cs 112ms 4.2ms 29.6MB 80ms 3ms dotnet 7.0.202
8.cs 133ms 0.5ms 24.9MB 120ms 0ms mono 6.12.0

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 767ms 4.0ms 19.9MB 757ms 3ms dotnet/aot 7.0.202
2.cs 935ms 6.5ms 36.4MB 913ms 0ms dotnet 7.0.202
1.cs 1001ms 26ms 68.0MB 973ms 20ms dotnet/aot 7.0.202
1.cs 1121ms 52ms 86.7MB 1090ms 13ms mono 6.12.0
1.cs 2417ms 106ms 88.2MB 2367ms 17ms dotnet 7.0.202
2.cs 2459ms 3.9ms 32.4MB 2440ms 7ms mono 6.12.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 142ms 1.6ms 29.8MB 130ms 3ms dotnet/aot 7.0.202
1.cs 188ms 1.2ms 40.7MB 177ms 3ms mono 6.12.0
2.cs 192ms 2.3ms 15.2MB 187ms 0ms dotnet/aot 7.0.202
2.cs 277ms 5.3ms 32.1MB 237ms 7ms dotnet 7.0.202
1.cs 404ms 6.3ms 42.2MB 363ms 7ms dotnet 7.0.202
2.cs 604ms 1.7ms 25.6MB 587ms 3ms mono 6.12.0

pidigits

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 4619ms 5.6ms 76.5MB 4583ms 40ms dotnet/aot 7.0.202
1.cs 4727ms 58ms 100.9MB 4663ms 100ms dotnet 7.0.202

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 1098ms 3.1ms 75.8MB 1073ms 23ms dotnet/aot 7.0.202
1.cs 1181ms 2.6ms 95.0MB 1173ms 37ms dotnet 7.0.202

regex-redux

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
5.cs 3332ms 22ms 525.7MB 3350ms 173ms dotnet 7.0.202
6.cs 3638ms 28ms 508.8MB 3497ms 190ms dotnet/aot 7.0.202
6.cs 3880ms 55ms 526.4MB 3787ms 163ms dotnet 7.0.202
5.cs timeout 0.0ms 186.1MB 4970ms 77ms dotnet/aot 7.0.202

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
6.cs 386ms 4.8ms 72.5MB 363ms 23ms dotnet/aot 7.0.202
5.cs 478ms 6.5ms 95.0MB 423ms 33ms dotnet 7.0.202
6.cs 594ms 23ms 87.3MB 523ms 30ms dotnet 7.0.202
5.cs 700ms 6.0ms 71.6MB 680ms 23ms dotnet/aot 7.0.202

secp256k1

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 3813ms 8.5ms 73.5MB 3773ms 30ms dotnet/aot 7.0.202
1.cs 4185ms 44ms 97.7MB 4157ms 47ms dotnet 7.0.202

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 991ms 8.1ms 75.2MB 960ms 23ms dotnet/aot 7.0.202
1.cs 1228ms 46ms 92.2MB 1167ms 43ms dotnet 7.0.202

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.cs 2587ms 55ms 13.7MB 4970ms 3ms dotnet/aot 7.0.202
3-m.cs 4771ms 272ms 32.6MB 8337ms 20ms dotnet 7.0.202
3.cs timeout 0.0ms 26.6MB 9770ms 10ms mono 6.12.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.cs 654ms 2.2ms 8.3MB 1247ms 3ms dotnet/aot 7.0.202
3-m.cs 1214ms 12ms 32.0MB 2263ms 13ms dotnet 7.0.202
3-m.cs 3194ms 149ms 27.6MB 6043ms 7ms mono 6.12.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.cs 179ms 0.9ms 12.3MB 320ms 3ms dotnet/aot 7.0.202
3-m.cs 381ms 4.9ms 33.5MB 637ms 7ms dotnet 7.0.202
3-m.cs 807ms 4.1ms 27.6MB 1530ms 3ms mono 6.12.0