All C# benchmarks

Current benchmark data was generated on Fri Jul 01 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz (Model 85)

* -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 1848ms 18ms 302.0MB 1713ms 193ms dotnet 6.0.301
1.cs 3003ms 47ms 104.3MB 3600ms 200ms mono 6.12.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 196ms 2.1ms 44.6MB 167ms 20ms mono 6.12.0
1.cs 238ms 8.9ms 75.3MB 180ms 30ms dotnet 6.0.301

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs timeout 0.0ms 0.0MB 0ms 0ms dotnet 6.0.301

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.cs 503ms 12ms 73.5MB 783ms 40ms dotnet 6.0.301

edigits

Input: 250001

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs timeout 0.0ms 0.0MB 0ms 0ms dotnet 6.0.301

Input: 100000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 1117ms 14ms 47.9MB 1067ms 23ms dotnet 6.0.301

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
5-m.cs 437ms 29ms 73.6MB 630ms 130ms dotnet 6.0.301
5-m.cs 639ms 6.1ms 67.1MB 1073ms 130ms mono 6.12.0

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
5-m.cs 112ms 3.7ms 36.3MB 133ms 40ms mono 6.12.0
5.cs 124ms 5.1ms 42.7MB 97ms 50ms dotnet 6.0.301

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 27ms 2.9ms 24.2MB 10ms 2ms mono 6.12.0
1.cs 56ms 1.7ms 29.0MB 28ms 4ms dotnet 6.0.301

http-server

Input: 3000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-http2.cs 800ms 6.8ms 118.2MB 917ms 110ms dotnet 6.0.301
2.cs 1037ms 28ms 159.9MB 940ms 530ms dotnet 6.0.301
1-m.cs 1099ms 98ms 179.2MB 1163ms 517ms dotnet 6.0.301

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 550ms 9.4ms 81.4MB 470ms 140ms dotnet 6.0.301
1.cs 586ms 5.9ms 91.3MB 580ms 157ms dotnet 6.0.301
2-http2.cs 627ms 15ms 83.8MB 643ms 60ms dotnet 6.0.301

json-serde

Input: sample 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 426ms 4.1ms 67.8MB 377ms 30ms dotnet 6.0.301
1.cs 731ms 11ms 145.1MB 647ms 73ms dotnet 6.0.301

Input: canada 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 2512ms 24ms 268.0MB 2600ms 140ms dotnet 6.0.301
1.cs 3958ms 74ms 796.9MB 3840ms 450ms dotnet 6.0.301

knucleotide

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
6-m.cs 1600ms 23ms 77.0MB 2350ms 50ms dotnet 6.0.301
6-m.cs 2268ms 53ms 71.9MB 3720ms 43ms mono 6.12.0

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
6.cs 307ms 12ms 66.4MB 337ms 33ms dotnet 6.0.301
6.cs 329ms 9.0ms 56.7MB 433ms 30ms mono 6.12.0

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 240ms 3.9ms 25.3MB 227ms 0ms mono 6.12.0
2.cs 245ms 5.9ms 30.0MB 207ms 7ms dotnet 6.0.301
1.cs 2202ms 61ms 75.0MB 2163ms 27ms dotnet 6.0.301
1.cs 4102ms 31ms 47.5MB 4043ms 50ms mono 6.12.0

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 563ms 8.0ms 30.3MB 530ms 7ms dotnet 6.0.301
2.cs 638ms 1.3ms 25.0MB 617ms 3ms mono 6.12.0
1.cs timeout 0.0ms 0.0MB 0ms 0ms dotnet 6.0.301
1.cs timeout 0.0ms 0.0MB 0ms 0ms mono 6.12.0

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 134ms 1.6ms 25.3MB 120ms 0ms mono 6.12.0
2.cs 154ms 6.5ms 28.0MB 123ms 10ms dotnet 6.0.301
1.cs timeout 0.0ms 0.0MB 0ms 0ms dotnet 6.0.301
1.cs timeout 0.0ms 0.0MB 0ms 0ms mono 6.12.0

mandelbrot

Input: 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 810ms 3.6ms 83.6MB 750ms 30ms dotnet 6.0.301
1.cs 4167ms 21ms 34.8MB 4117ms 17ms dotnet 6.0.301
3.cs 4491ms 46ms 36.2MB 4447ms 13ms dotnet 6.0.301
1.cs timeout 0.0ms 0.0MB 0ms 0ms mono 6.12.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 126ms 27ms 38.7MB 83ms 13ms dotnet 6.0.301
3.cs 271ms 7.3ms 31.1MB 240ms 7ms dotnet 6.0.301
1.cs 354ms 2.9ms 31.4MB 320ms 10ms dotnet 6.0.301
1.cs 900ms 5.8ms 26.8MB 877ms 10ms mono 6.12.0

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 1268ms 10ms 303.6MB 1090ms 207ms dotnet 6.0.301
2.cs 1271ms 24ms 389.9MB 1107ms 207ms dotnet 6.0.301
1.cs 2319ms 19ms 147.5MB 2903ms 163ms mono 6.12.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 352ms 6.8ms 131.3MB 277ms 50ms dotnet 6.0.301
1.cs 364ms 1.7ms 164.0MB 267ms 83ms dotnet 6.0.301
1.cs 415ms 7.9ms 73.6MB 397ms 40ms mono 6.12.0

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
9.cs 528ms 5.3ms 29.2MB 490ms 7ms dotnet 6.0.301
8.cs 744ms 2.0ms 29.2MB 707ms 3ms dotnet 6.0.301
8.cs 1586ms 12ms 25.0MB 1563ms 7ms mono 6.12.0

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
9.cs 111ms 2.7ms 27.2MB 73ms 7ms dotnet 6.0.301
8.cs 136ms 4.8ms 29.1MB 93ms 13ms dotnet 6.0.301
8.cs 195ms 2.0ms 25.1MB 170ms 7ms mono 6.12.0

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.cs 1310ms 0.5ms 36.1MB 1273ms 7ms dotnet 6.0.301
1.cs 1314ms 49ms 91.9MB 1257ms 27ms dotnet 6.0.301
1.cs 1468ms 24ms 88.7MB 1427ms 27ms mono 6.12.0
2.cs 3449ms 45ms 32.4MB 3430ms 0ms mono 6.12.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 220ms 12ms 47.7MB 173ms 13ms dotnet 6.0.301
1.cs 223ms 4.0ms 42.5MB 203ms 3ms mono 6.12.0
2.cs 361ms 1.9ms 31.7MB 320ms 10ms dotnet 6.0.301
2.cs 841ms 13ms 25.8MB 817ms 7ms mono 6.12.0

pidigits

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs timeout 0.0ms 0.0MB 0ms 0ms dotnet 6.0.301

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 1574ms 6.5ms 79.7MB 1570ms 47ms dotnet 6.0.301

regex-redux

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
5.cs 3798ms 13ms 602.1MB 3663ms 323ms dotnet 7.0.100-preview.5.22307.18
5p.cs 4304ms 34ms 592.2MB 4173ms 263ms dotnet 7.0.100-preview.5.22307.18
5.cs timeout 0.0ms 0.0MB 0ms 0ms dotnet 6.0.301

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
5.cs 565ms 14ms 166.9MB 477ms 77ms dotnet 7.0.100-preview.5.22307.18
5p.cs 614ms 4.1ms 164.2MB 523ms 77ms dotnet 7.0.100-preview.5.22307.18
5.cs 639ms 2.5ms 91.3MB 600ms 20ms dotnet 6.0.301

secp256k1

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs timeout 0.0ms 0.0MB 0ms 0ms dotnet 6.0.301

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.cs 1530ms 13ms 79.0MB 1520ms 23ms dotnet 6.0.301

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.cs 3506ms 519ms 32.6MB 5830ms 33ms dotnet 6.0.301
3.cs timeout 0.0ms 0.0MB 0ms 0ms mono 6.12.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.cs 838ms 12ms 30.2MB 1503ms 10ms dotnet 6.0.301
3-m.cs 3306ms 150ms 29.5MB 6207ms 13ms mono 6.12.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
3-m.cs 277ms 1.2ms 32.3MB 403ms 13ms dotnet 6.0.301
3-m.cs 841ms 3.4ms 27.6MB 1563ms 13ms mono 6.12.0