The Computer Language
24.11 Benchmarks Game

C# .NET versus C# aot fastest performance

How the programs are written matters! Always look at the source code.

If the fastest programs are * hand-written vector instructions, does the host language matter? You might be more interested in the less optimised programs — more seconds, less gz source code.

fannkuch-redux
source secs mem gz cpu secs
C# aot #5 2.16 19,620 1485 8.57
* C# .NET #5 2.27 29,584 1485 8.79
C# .NET #2 30.38 28,804 584 30.37
C# aot #2 31.28 19,620 584 31.27
C# aot #9 8.10 19,620 1232 32.31
* C# .NET #9 8.40 29,608 1232 33.33
C# .NET #6 9.93 29,272 1075 39.49
C# aot #6 10.11 19,620 1075 40.42
C# .NET #3 11.01 29,020 1117 43.46
C# aot #3 11.00 19,620 1117 43.50
C# .NET #8 43.80 28,760 519 43.78
C# aot #8 44.61 19,620 519 44.60
n-body
source secs mem gz cpu secs
C# aot #9 3.11 19,620 2480 3.11
* C# .NET #9 3.17 28,604 2480 3.17
C# aot #4 3.69 19,620 2137 3.69
* C# .NET #4 3.75 28,504 2137 3.75
C# aot #7 4.73 19,620 1715 4.73
C# aot #6 4.75 19,620 1754 4.75
* C# .NET #7 4.80 28,564 1715 4.80
* C# .NET #6 4.83 28,512 1754 4.83
C# aot #0 6.39 19,620 1342 6.39
C# aot 6.39 19,620 1424 6.39
C# .NET #3 6.65 29,280 1311 6.64
C# aot #3 6.65 19,620 1311 6.65
C# aot #2 6.80 19,620 1339 6.80
C# .NET #2 6.89 29,284 1339 6.89
C# aot #8 7.00 19,620 1335 7.00
C# .NET #8 7.21 29,068 1335 7.21
C# .NET 7.66 29,380 1424 7.66
C# .NET #0 7.66 29,360 1342 7.66
spectral-norm
source secs mem gz cpu secs
C# aot #5 0.73 19,620 776 2.87
* C# .NET #5 0.94 33,752 776 3.42
C# aot #8 5.33 19,620 441 5.33
C# .NET #8 5.41 29,720 441 5.40
C# aot #2 1.47 19,620 1084 5.71
C# .NET #2 1.52 29,864 1084 5.78
C# aot #3 1.47 19,620 890 5.79
C# .NET #3 1.54 31,460 890 5.80
mandelbrot
source secs mem gz cpu secs
C# aot #7 2.95 36,040 915 11.72
* C# .NET #7 3.21 66,484 915 12.50
C# aot 3.75 36,080 1980 14.93
C# aot #9 3.76 36,024 822 14.94
* C# .NET 3.93 64,440 1980 15.41
* C# .NET #9 3.93 64,332 822 15.45
C# aot #5 4.00 37,728 851 15.87
C# .NET #5 4.06 63,344 851 15.87
C# aot #8 25.56 19,620 492 25.55
C# .NET #8 26.41 29,820 492 26.41
C# aot #3 6.67 36,584 722 26.51
C# .NET #3 6.79 61,964 722 26.79
C# aot #2 46.14 19,620 504 46.12
C# .NET #2 46.19 29,604 504 46.19
fasta
source secs mem gz cpu secs
C# aot #9 1.15 19,620 1512 1.15
C# .NET #9 1.21 29,432 1512 1.21
C# aot #5 1.08 45,836 1702 4.23
C# .NET #8 5.40 32,864 904 5.42
C# .NET #5 1.48 50,620 1702 5.45
C# aot 1.60 19,620 2113 5.69
C# aot #8 6.23 19,964 904 6.22
C# .NET 1.70 36,636 2113 6.23
k-nucleotide
source secs mem gz cpu secs
C# aot 3.08 153,728 2046 10.56
C# .NET 3.18 181,724 2046 10.77
C# aot #6 5.08 152,196 1615 12.83
C# .NET #6 5.63 180,500 1615 14.88
C# .NET #4 12.06 612,408 1725 42.10
C# .NET #7 42.74 613,184 1449 43.35
C# aot #4 12.88 577,808 1725 45.69
C# aot #7 47.60 571,928 1449 48.16
C# aot #8 72.83 1,322,384 736 73.39
C# .NET #8 75.50 1,371,044 736 76.56
reverse-complement
source secs mem gz cpu secs
C# .NET #9 0.59 733,932 2641 1.37
C# .NET 3.14 583,252 1130 3.18
C# aot 3.23 548,304 1130 3.25
C# aot #5 2.71 998,644 1620 3.73
C# .NET #6 1.55 1,027,196 1627 3.76
C# .NET #5 2.53 1,025,008 1620 3.83
C# aot #7 1.43 816,640 1312 3.92
C# aot #6 1.71 1,001,884 1627 4.12
C# .NET #7 1.54 927,984 1312 4.25
C# aot #3 8.66 1,368,572 934 13.17
C# .NET #3 8.47 1,380,908 934 13.21
C# aot #9   Bad Output  
binary-trees
source secs mem gz cpu secs
C# .NET #8 13.50 883,524 601 15.31
C# aot #8 14.53 835,476 601 16.02
C# aot #2 5.04 1,203,112 717 16.32
C# aot #7 5.32 1,167,436 706 17.19
C# .NET #7 5.34 1,074,228 706 17.42
C# .NET #2 5.37 1,083,480 717 17.60
C# aot #3 5.85 2,944,336 688 17.86
C# aot 5.69 2,875,588 668 18.10
C# .NET 6.11 3,178,448 668 19.93
C# .NET #3 6.45 2,900,008 688 20.33
C# aot #6   Make Error  
C# .NET #6   Make Error  
pidigits
source secs mem gz cpu secs
C# aot #6 0.74 19,620 1182 0.74
* C# .NET #6 0.82 30,744 1182 0.82
* C# .NET #5 0.84 33,264 990 0.88
* C# .NET #4 1.29 31,392 1135 1.29
C# aot #4 4.53 19,620 1135 4.53
C# aot #7 6.43 19,620 579 6.39
C# .NET #7 7.15 38,160 579 7.25
C# aot #5 99.21 19,620 990 99.18
regex-redux
source secs mem gz cpu secs
C# aot #2 1.30 327,112 1881 2.50
C# .NET #2 1.36 402,516 1881 2.60
C# .NET 4.60 599,212 641 4.83
C# .NET #5 1.74 614,536 679 5.02
C# aot 10.61 566,272 641 10.61
C# aot #5 3.20 579,456 679 10.70
C# .NET #4 8.65 854,996 854 29.97
C# aot #4 9.74 729,588 854 33.09
C# .NET

.NET SDK 9.0.100
Host Version: 9.0.0
Commit: 9d5a6a9aa4

<OutputType>Exe
<TargetFramework>net9.0
<ImplicitUsings>enable
<Nullable>enable
<AllowUnsafeBlocks>true
<ServerGarbageCollection>true
<ConcurrentGarbageCollection>true
<PublishAot>false

C# aot

.NET SDK 9.0.100
Host Version: 9.0.0
Commit: 9d5a6a9aa4

<OutputType>Exe
<TargetFramework>net9.0
<ImplicitUsings>enable
<Nullable>enable
<AllowUnsafeBlocks>true
<ServerGarbageCollection>true
<ConcurrentGarbageCollection>true
<PublishAot>true
<OptimizationPreference>Speed
<IlcInstructionSet>native