Dart VS C# benchmarks

Current benchmark data was generated on Thu Dec 26 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
dart 1.dart 729ms 7.9ms 80.7MB 700ms 37ms dart/exe 3.6.0
csharp 1.cs 947ms 28ms 194.9MB 933ms 143ms dotnet 9.0.101
csharp 1.cs 976ms 0.9ms 177.5MB 950ms 140ms dotnet/aot 9.0.101
csharp 1.cs 1748ms 63ms 101.6MB 1953ms 227ms mono 6.12.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 78ms 0.8ms 42.9MB 50ms 13ms dart/exe 3.6.0
csharp 1.cs 134ms 9.4ms 43.4MB 83ms 30ms dotnet/aot 9.0.101
csharp 1.cs 143ms 1.3ms 46.2MB 113ms 17ms mono 6.12.0
csharp 1.cs 194ms 10ms 61.9MB 150ms 40ms dotnet 9.0.101

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1-m.dart 1652ms 2861ms 19.1MB 5583ms 77ms dart/exe 3.6.0
csharp 1-m.cs 2142ms 93ms 67.2MB 7337ms 103ms dotnet/aot 9.0.101
csharp 1-m.cs 2701ms 106ms 84.5MB 8340ms 103ms dotnet 9.0.101

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1-m.cs 156ms 6.0ms 31.1MB 407ms 13ms dotnet/aot 9.0.101
csharp 1-m.cs 282ms 18ms 49.9MB 737ms 37ms dotnet 9.0.101
dart 1.dart 343ms 1.4ms 10.3MB 343ms 20ms dart/exe 3.6.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 3563ms 22ms 18.0MB 3533ms 27ms dart/exe 3.6.0
csharp 1.cs 4084ms 9.8ms 24.1MB 4050ms 17ms dotnet/aot 9.0.101
csharp 1.cs 4950ms 5.4ms 43.9MB 4920ms 23ms dotnet 9.0.101

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 585ms 1.6ms 10.1MB 563ms 13ms dart/exe 3.6.0
csharp 1.cs 678ms 0.9ms 20.6MB 657ms 7ms dotnet/aot 9.0.101
csharp 1.cs 871ms 2.2ms 40.1MB 847ms 13ms dotnet 9.0.101

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 2748ms 14ms 6.1MB 2737ms 0ms dart/exe 3.6.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 227ms 3.7ms 6.1MB 217ms 0ms dart/exe 3.6.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 139ms 2.0ms 43.0MB 370ms 103ms dotnet/aot 9.0.101
csharp 5-m.cs 189ms 4.4ms 49.2MB 470ms 117ms dotnet 9.0.101
csharp 5-m.cs 258ms 4.1ms 54.5MB 663ms 147ms mono 6.12.0
dart 1.dart 362ms 4.0ms 8.9MB 350ms 0ms dart/exe 3.6.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 27ms 0.8ms 25.2MB 33ms 17ms dotnet/aot 9.0.101
dart 1.dart 42ms 0.5ms 8.8MB 33ms 0ms dart/exe 3.6.0
csharp 5-m.cs 63ms 3.3ms 46.9MB 73ms 27ms dotnet 9.0.101
csharp 5-m.cs 71ms 2.2ms 39.3MB 103ms 20ms mono 6.12.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 4.1ms 0.2ms 6.3MB 0ms 0ms dart/exe 3.6.0
csharp 1.cs 11ms 8.5ms 15.8MB 0ms 0ms dotnet/aot 9.0.101
csharp 1.cs 31ms 0.6ms 23.5MB 18ms 2ms mono 6.12.0
csharp 1.cs 37ms 1.1ms 32.2MB 24ms 6ms dotnet 9.0.101

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2-http2.cs 543ms 8.4ms 120.4MB 750ms 153ms dotnet 9.0.101
csharp 2-http3.cs 698ms 11ms 157.4MB 1110ms 313ms dotnet 9.0.101
csharp 2-m.cs 732ms 20ms 153.5MB 763ms 607ms dotnet 9.0.101
csharp 1-m.cs 838ms 90ms 175.2MB 1223ms 763ms dotnet 9.0.101
dart 2-m.dart 1493ms 15ms 115.8MB 1150ms 1607ms dart/exe 3.6.0
dart 1.dart 4313ms 195ms 118.9MB 1230ms 1553ms dart/exe 3.6.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2-m.dart 309ms 8.5ms 50.0MB 203ms 293ms dart/exe 3.6.0
csharp 2.cs 394ms 11ms 98.6MB 370ms 220ms dotnet 9.0.101
csharp 1-m.cs 430ms 22ms 109.2MB 503ms 260ms dotnet 9.0.101
csharp 2-http2.cs 479ms 20ms 99.7MB 503ms 100ms dotnet 9.0.101
csharp 2-http3.cs 509ms 7.1ms 107.3MB 580ms 120ms dotnet 9.0.101
dart 1.dart 1340ms 116ms 49.9MB 153ms 253ms dart/exe 3.6.0

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 168ms 2.3ms 54.2MB 150ms 10ms dart/exe 3.6.0
csharp 2.cs 310ms 13ms 80.5MB 263ms 40ms dotnet 9.0.101
csharp 1.cs 774ms 67ms 153.1MB 780ms 93ms dotnet 9.0.101

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 1476ms 12ms 299.3MB 1540ms 117ms dart/exe 3.6.0
csharp 2.cs 1607ms 113ms 224.8MB 1787ms 83ms dotnet 9.0.101
csharp 1.cs 2588ms 24ms 684.9MB 3017ms 370ms dotnet 9.0.101

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 6-m.cs 465ms 10ms 55.1MB 1220ms 13ms dotnet/aot 9.0.101
csharp 6-m.cs 800ms 69ms 76.9MB 1863ms 50ms dotnet 9.0.101
csharp 6-m.cs 1009ms 13ms 66.8MB 2887ms 27ms mono 6.12.0
dart 3-m.dart 1139ms 62ms 279.7MB 3300ms 113ms dart/exe 3.6.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 6-m.cs 84ms 3.6ms 43.8MB 140ms 17ms dotnet/aot 9.0.101
csharp 6-m.cs 200ms 3.2ms 54.4MB 387ms 17ms mono 6.12.0
csharp 6.cs 214ms 7.7ms 64.3MB 270ms 37ms dotnet 9.0.101
dart 3-m.dart 224ms 8.3ms 197.1MB 503ms 67ms dart/exe 3.6.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 96ms 2.0ms 16.1MB 87ms 0ms dotnet/aot 9.0.101
csharp 2.cs 149ms 2.3ms 26.8MB 137ms 0ms mono 6.12.0
dart 2.dart 163ms 2.7ms 9.3MB 150ms 0ms dart/exe 3.6.0
csharp 2.cs 261ms 1.8ms 35.6MB 247ms 7ms dotnet 9.0.101
dart 1.dart 511ms 5.2ms 9.1MB 493ms 0ms dart/exe 3.6.0
csharp 1.cs 1061ms 3.0ms 16.9MB 1043ms 3ms dotnet/aot 9.0.101
csharp 1.cs 1336ms 75ms 39.2MB 1327ms 10ms dotnet 9.0.101
csharp 1.cs 3341ms 25ms 43.5MB 3297ms 33ms mono 6.12.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 265ms 3.1ms 14.0MB 257ms 0ms dotnet/aot 9.0.101
csharp 2.cs 365ms 9.6ms 26.1MB 347ms 3ms mono 6.12.0
csharp 2.cs 441ms 29ms 35.7MB 417ms 7ms dotnet 9.0.101
dart 2.dart 473ms 6.0ms 9.1MB 463ms 0ms dart/exe 3.6.0
dart 1.dart 1527ms 12ms 9.1MB 1503ms 10ms dart/exe 3.6.0
csharp 1.cs 3166ms 13ms 19.2MB 3130ms 17ms dotnet/aot 9.0.101
csharp 1.cs 3561ms 17ms 39.2MB 3550ms 10ms dotnet 9.0.101
csharp 1.cs timeout 0.0ms 49.5MB 4940ms 50ms mono 6.12.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 52ms 1.6ms 13.5MB 40ms 0ms dotnet/aot 9.0.101
dart 2.dart 75ms 0.3ms 9.4MB 67ms 0ms dart/exe 3.6.0
csharp 2.cs 93ms 2.7ms 26.8MB 77ms 3ms mono 6.12.0
dart 1.dart 121ms 9.8ms 9.0MB 110ms 0ms dart/exe 3.6.0
csharp 2.cs 176ms 12ms 35.7MB 147ms 10ms dotnet 9.0.101
csharp 1.cs 1616ms 9.0ms 36.8MB 1600ms 13ms dotnet 9.0.101
csharp 1.cs 1808ms 0.6ms 18.9MB 1793ms 3ms dotnet/aot 9.0.101
csharp 1.cs 1828ms 17ms 30.8MB 1813ms 3ms mono 6.12.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 335ms 2.0ms 63.6MB 303ms 33ms dart/exe 3.6.0
csharp 2.cs 558ms 7.1ms 122.0MB 490ms 97ms dotnet/aot 9.0.101
csharp 1.cs 596ms 11ms 150.5MB 553ms 107ms dotnet/aot 9.0.101
csharp 2.cs 663ms 2.9ms 142.8MB 623ms 93ms dotnet 9.0.101
csharp 1.cs 759ms 21ms 167.4MB 693ms 130ms dotnet 9.0.101
csharp 1.cs 1296ms 26ms 142.6MB 1497ms 173ms mono 6.12.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 88ms 1.8ms 43.6MB 57ms 20ms dart/exe 3.6.0
csharp 2.cs 144ms 3.3ms 66.6MB 110ms 27ms dotnet/aot 9.0.101
csharp 1.cs 151ms 6.1ms 80.7MB 107ms 53ms dotnet/aot 9.0.101
csharp 1.cs 266ms 2.2ms 71.4MB 240ms 33ms mono 6.12.0
csharp 2.cs 271ms 16ms 83.0MB 223ms 33ms dotnet 9.0.101
csharp 1.cs 284ms 24ms 99.2MB 237ms 60ms dotnet 9.0.101

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 8.cs 374ms 2.4ms 16.0MB 360ms 0ms dotnet/aot 9.0.101
csharp 9.cs 374ms 14ms 34.0MB 343ms 0ms dotnet 9.0.101
dart 3.dart 408ms 3.0ms 6.1MB 397ms 0ms dart/exe 3.6.0
csharp 8.cs 422ms 3.6ms 33.7MB 397ms 10ms dotnet 9.0.101
csharp 8.cs 1249ms 8.1ms 24.3MB 1233ms 3ms mono 6.12.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 3.dart 46ms 0.1ms 6.3MB 33ms 0ms dart/exe 3.6.0
csharp 8.cs 47ms 1.1ms 15.7MB 30ms 0ms dotnet/aot 9.0.101
csharp 9.cs 93ms 1.9ms 34.0MB 73ms 7ms dotnet 9.0.101
csharp 8.cs 96ms 2.3ms 33.8MB 73ms 7ms dotnet 9.0.101
csharp 8.cs 163ms 1.5ms 26.4MB 143ms 7ms mono 6.12.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 1252ms 6.2ms 14.6MB 1213ms 37ms dart/exe 3.6.0
csharp 1.cs 3228ms 35ms 19.8MB 3103ms 113ms dotnet/aot 9.0.101
csharp 1.cs 3715ms 135ms 44.3MB 3690ms 127ms dotnet 9.0.101

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 311ms 4.2ms 14.8MB 290ms 17ms dart/exe 3.6.0
csharp 1.cs 753ms 0.7ms 21.3MB 713ms 30ms dotnet/aot 9.0.101
csharp 1.cs 986ms 12ms 43.8MB 1070ms 30ms dotnet 9.0.101

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 6.cs 1760ms 0.8ms 427.3MB 1653ms 160ms dotnet/aot 9.0.101
csharp 5.cs 2084ms 47ms 457.3MB 2110ms 187ms dotnet 9.0.101
csharp 6.cs 2694ms 2.8ms 449.8MB 2643ms 173ms dotnet 9.0.101
csharp 5.cs 4241ms 17ms 429.0MB 4130ms 163ms dotnet/aot 9.0.101
dart 1.dart timeout 0.0ms 204.3MB 4940ms 63ms dart/exe 3.6.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 6.cs 192ms 1.2ms 56.2MB 167ms 17ms dotnet/aot 9.0.101
csharp 5.cs 302ms 14ms 82.2MB 250ms 37ms dotnet 9.0.101
csharp 6.cs 395ms 7.5ms 77.4MB 360ms 27ms dotnet 9.0.101
csharp 5.cs 440ms 4.3ms 58.1MB 413ms 20ms dotnet/aot 9.0.101
dart 1.dart 559ms 5.1ms 48.0MB 537ms 13ms dart/exe 3.6.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 1884ms 25ms 18.6MB 7200ms 10ms dotnet/aot 9.0.101
csharp 3-m.cs 2212ms 231ms 38.1MB 6850ms 17ms dotnet 9.0.101
dart 1.dart 3742ms 9.1ms 6.4MB 3730ms 0ms dart/exe 3.6.0
dart 2.dart 4346ms 17ms 6.3MB 4333ms 0ms dart/exe 3.6.0
csharp 3-m.cs 4748ms 167ms 30.7MB 18287ms 30ms mono 6.12.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 478ms 1.1ms 18.7MB 1803ms 7ms dotnet/aot 9.0.101
csharp 3-m.cs 544ms 11ms 37.9MB 1860ms 17ms dotnet 9.0.101
dart 1.dart 939ms 2.8ms 6.3MB 927ms 0ms dart/exe 3.6.0
dart 2.dart 1097ms 4.9ms 6.3MB 1087ms 0ms dart/exe 3.6.0
csharp 3-m.cs 1192ms 38ms 29.5MB 4420ms 13ms mono 6.12.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 130ms 0.7ms 16.5MB 437ms 13ms dotnet/aot 9.0.101
csharp 3-m.cs 180ms 2.1ms 38.7MB 490ms 17ms dotnet 9.0.101
dart 1.dart 242ms 2.8ms 6.3MB 233ms 0ms dart/exe 3.6.0
dart 2.dart 280ms 1.9ms 6.1MB 267ms 0ms dart/exe 3.6.0
csharp 3-m.cs 354ms 9.7ms 30.4MB 1180ms 17ms mono 6.12.0