The Computer Language
24.11 Benchmarks Game

Go 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# aot #2 31.28 19,620 584 31.27
C# aot #9 8.10 19,620 1232 32.31
Go #3 8.34 19,808 975 33.31
C# aot #6 10.11 19,620 1075 40.42
C# aot #3 11.00 19,620 1117 43.50
C# aot #8 44.61 19,620 519 44.60
Go #8 46.13 19,440 500 46.24
Go 12.29 19,808 906 49.04
Go #2 12.35 19,808 903 49.32
n-body
source secs mem gz cpu secs
C# aot #9 3.11 19,620 2480 3.11
C# aot #4 3.69 19,620 2137 3.69
C# aot #7 4.73 19,620 1715 4.73
C# aot #6 4.75 19,620 1754 4.75
C# aot #0 6.39 19,620 1342 6.39
C# aot 6.39 19,620 1424 6.39
Go #3 6.38 19,808 1207 6.40
C# aot #3 6.65 19,620 1311 6.65
C# aot #2 6.80 19,620 1339 6.80
C# aot #8 7.00 19,620 1335 7.00
Go 7.01 19,808 1316 7.03
Go #2 7.03 19,808 1222 7.05
Go #8 9.60 19,436 1224 9.62
spectral-norm
source secs mem gz cpu secs
C# aot #5 0.73 19,620 776 2.87
C# aot #8 5.33 19,620 441 5.33
Go #8 5.33 19,416 429 5.34
Go 5.33 19,808 417 5.34
Go #2 1.50 19,808 674 5.68
Go #4 1.45 19,808 555 5.69
C# aot #2 1.47 19,620 1084 5.71
C# aot #3 1.47 19,620 890 5.79
mandelbrot
source secs mem gz cpu secs
C# aot #7 2.95 36,040 915 11.72
C# aot 3.75 36,080 1980 14.93
C# aot #9 3.76 36,024 822 14.94
Go #4 3.76 35,456 912 14.99
Go #3 3.77 35,456 900 15.00
C# aot #5 4.00 37,728 851 15.87
Go 5.02 33,024 829 20.02
C# aot #8 25.56 19,620 492 25.55
C# aot #3 6.67 36,584 722 26.51
Go #8 26.68 19,440 500 26.74
Go #2 6.85 33,152 843 27.28
Go #6 6.89 33,024 707 27.44
C# aot #2 46.14 19,620 504 46.12
fasta
source secs mem gz cpu secs
C# aot #9 1.15 19,620 1512 1.15
Go 3.73 19,808 1055 3.74
Go #2 1.27 19,808 1405 4.06
Go #3 1.51 19,808 1362 4.09
C# aot #5 1.08 45,836 1702 4.23
C# aot 1.60 19,620 2113 5.69
C# aot #8 6.23 19,964 904 6.22
Go #8 11.46 19,820 880 11.55
k-nucleotide
source secs mem gz cpu secs
C# aot 3.08 153,728 2046 10.56
C# aot #6 5.08 152,196 1615 12.83
Go #7 7.63 163,072 1613 28.79
Go #3 8.18 145,280 1729 29.88
Go #6 8.21 145,152 1596 30.01
Go #4 9.16 140,032 1552 31.38
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
reverse-complement
source secs mem gz cpu secs
Go #2 2.19 800,640 614 2.29
Go #3 2.48 800,384 609 2.57
C# aot 3.23 548,304 1130 3.25
Go #6 1.91 1,244,508 1340 3.40
C# aot #5 2.71 998,644 1620 3.73
C# aot #7 1.43 816,640 1312 3.92
C# aot #6 1.71 1,001,884 1627 4.12
C# aot #3 8.66 1,368,572 934 13.17
Go #5   Bad Output  
Go   Failed  
C# aot #9   Bad Output  
binary-trees
source secs mem gz cpu secs
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# aot #3 5.85 2,944,336 688 17.86
C# aot 5.69 2,875,588 668 18.10
Go #6 27.90 404,096 618 29.26
Go #2 14.17 624,780 672 56.29
Go #3 14.91 326,508 806 58.00
Go #5 14.87 425,960 957 58.15
Go 32.01 243,192 488 59.78
Go #7 32.52 248,604 531 61.47
C# aot #6   Make Error  
pidigits
source secs mem gz cpu secs
C# aot #6 0.74 19,620 1182 0.74
* Go #4 0.82 19,808 689 0.83
Go 1.18 19,808 715 1.20
* Go #3 1.40 19,808 610 1.44
Go #2 1.84 19,808 740 1.89
Go #6 2.46 19,512 727 2.46
C# aot #4 4.53 19,620 1135 4.53
Go #7 4.99 19,808 702 5.61
C# aot #7 6.43 19,620 579 6.39
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
Go #5 3.25 321,360 817 5.43
C# aot 10.61 566,272 641 10.61
C# aot #5 3.20 579,456 679 10.70
C# aot #4 9.74 729,588 854 33.09
Go #4 14.61 369,008 832 35.91
Go 25.37 319,956 749 61.07
Go #3 25.62 371,204 836 61.79
Go

go version go1.23.1 linux/amd64
GOAMD64=v2

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