The Computer Language
25.03 Benchmarks Game

C# versus C# naot

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

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

fannkuch-redux      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* C# naot #5 2.16 8.58 6,713 1485 24.43
* C# #5 2.35 9.03 33,559 1485 7.63
C# #2 30.41 30.39 32,924 584 8.13
C# naot #2 31.30 31.29 6,001 584 23.80
* C# naot #9 8.11 32.35 6,377 1232 25.65
* C# #9 8.43 33.37 34,038 1232 7.74
C# #6 9.95 39.50—39.54 33,300 1075 7.64
C# naot #6 10.14 40.45—40.53 6,799 1075 24.13
C# #3 11.04 44.49—46.04 33,182 1117 7.89
C# naot #3 11.01 43.53—43.61 6,472 1117 23.77
C# #8 43.84 43.83—43.87 32,858 519 7.51
C# naot #8 44.63 44.63 6,091 519 24.31
n-body      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* C# naot #9 3.13 3.12 6,087 2480 24.34
* C# #9 3.20 3.18 32,059 2480 7.92
* C# naot #4 3.70 3.70 6,078 2137 24.03
* C# #4 3.77 3.75 32,215 2137 8.55
* C# naot #7 4.74 4.74 6,091 1715 23.78
* C# naot #6 4.77 3.92—6.97 6,115 1754 23.74
* C# #7 4.83 4.81 32,297 1715 7.54
* C# #6 4.85 4.84 32,203 1754 7.89
C# #3 6.68 6.66 33,280 1311 7.62
C# naot #3 6.67 6.65—6.70 6,095 1311 23.76
C# naot #2 6.81 6.81 5,898 1339 24.15
C# #2 6.92 6.92 33,280 1339 7.93
C# naot #8 7.02 7.01 5,833 1335 23.65
C# #8 7.24 7.23 32,870 1335 7.70
C# naot #0 7.46 7.46 6,107 1342 23.74
C# naot 7.46 7.45 6,124 1424 24.21
C# 7.68 7.67 33,341 1424 7.60
C# #0 7.68 7.67 33,300 1342 7.60
spectral-norm      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* C# naot #5 0.74 2.88 8,057 776 24.00
* C# #5 0.96 3.44—3.64 37,929 776 8.71
C# naot #8 5.35 5.34 6,820 441 24.29
C# #8 5.43 5.41 33,214 441 7.70
C# naot #2 1.47 5.72 6,644 1084 24.38
C# naot #3 1.48 5.80 6,808 890 23.72
C# #3 1.56 5.82 36,172 890 8.36
C# #2   Empty  
mandelbrot      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* C# naot #7 2.96 11.74 39,088 915 24.73
* C# #7 3.23 12.59—12.90 73,056 915 7.76
* C# naot #9 3.77 14.95 38,797 822 27.91
* C# naot 3.76 14.95 39,240 1980 24.86
* C# 3.97 15.56—15.67 70,214 1980 10.98
* C# #9 3.95 15.46—15.61 70,402 822 7.95
C# #5 4.08 15.88 68,202 851 11.86
C# naot #5 4.02 15.90 40,743 851 27.06
C# naot #8 25.58 25.55—25.66 6,115 492 24.73
C# #8 26.42 26.42 33,915 492 7.59
C# naot #3 6.69 26.53 39,715 722 24.95
C# #3 6.81 26.76—26.83 66,859 722 7.65
C# naot #2 47.60 47.84—48.30 6,148 504 24.02
C# #2 47.72 48.00—48.46 33,300 504 7.60
fasta      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
C# naot #9 1.16 1.16 6,218 1512 24.53
C# #9 1.23 1.23 33,571 1512 7.79
C# naot #5 1.14 4.34—4.48 34,853 1702 24.14
C# #5 1.53 5.45—5.54 47,833 1702 7.79
C# #8 5.80 5.49 37,343 904 8.59
C# naot 1.61 5.65—5.71 11,055 2113 24.61
C# 1.80 6.22—6.38 40,841 2113 7.88
C# naot #8 6.60 6.30 8,823 904 23.99
k-nucleotide      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
C# 3.26 10.80—11.05 190,829 2046 7.66
C# naot 3.12 10.70—10.91 160,424 2046 27.36
C# naot #6 5.02 13.07—13.88 158,015 1615 26.90
C# #6 5.73 15.07—15.28 189,972 1615 7.65
C# #4 12.25 43.35—45.07 606,466 1725 7.64
C# #7 42.96 43.57—43.83 557,740 1449 7.50
C# naot #4 13.01 45.70—45.82 523,211 1725 27.45
C# naot #7 48.00 48.44—48.60 593,142 1449 23.68
C# naot #8 83.91 75.78—77.28 1,354,269 736 24.68
C# #8 87.51 79.54—80.86 1,408,664 736 7.89
reverse-complement      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* C# #9 0.68 1.51 550,793 2641 12.35
C# 3.32 3.31—3.39 666,341 1130 7.59
C# naot 3.37 3.40—3.44 637,997 1130 24.13
C# naot #5 2.74 3.76 1,027,035 1620 24.63
C# #5 2.59 3.87 1,056,952 1620 7.47
C# #6 1.75 4.03—4.07 1,058,517 1627 7.69
C# naot #7 1.56 4.14—4.23 774,136 1312 23.76
C# naot #6 1.81 4.27—4.31 1,029,992 1627 24.50
C# #7 1.69 4.47—4.62 967,602 1312 11.98
C# naot #3 8.76 13.32—13.49 1,236,947 934 23.97
C# #3 8.65 13.47—13.71 1,266,110 934 8.01
* C# naot #9   Bad Output  
binary-trees      [ Contentious. Different approaches. ]
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
C# naot #7 6.22 17.09—17.67 1,115,476 706 23.97
C# naot #2 6.22 17.12—17.72 1,018,946 717 23.74
C# naot #3 6.71 18.09—18.62 2,829,128 688 23.94
C# #2 6.47 18.08—18.35 1,107,055 717 7.59
C# #7 6.40 18.01—18.41 1,053,831 706 7.48
C# naot 6.80 18.92—19.25 2,819,092 668 24.30
C# 7.20 20.10—20.51 3,005,301 668 8.11
C# #3 7.42 20.59—21.11 3,014,975 688 7.55
C# naot #6   Empty  
C# #6   Empty  
pidigits      [ Contentious. Different libraries. ]
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* C# naot #6 0.75 0.75 7,905 1182 23.89
* C# #6 0.84 0.82 34,796 1182 7.91
* C# #5 0.86 0.89 37,335 990 7.47
* C# #4 1.31 1.30 35,496 1135 7.69
* C# naot #4 4.54 4.53 8,053 1135 28.23
C# naot #7 11.42 8.23—9.42 11,723 579 24.08
C# #7 11.08 9.19—10.76 44,098 579 7.80
* C# naot #5 99.09 99.08—99.12 8,466 990 24.29
regex-redux      [ Contentious. Different libraries. ]
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* C# naot #2 1.36 2.55 320,512 1881 25.36
* C# #2 1.43 2.64 402,747 1881 7.54
C# 4.63 4.83 618,988 641 7.95
C# #5 1.90 5.18—5.38 632,472 679 7.53
C# naot 10.69 10.70—10.79 582,550 641 27.07
C# naot #5 3.25 10.73—10.77 596,599 679 26.47
C# #4 8.59 30.62—33.76 882,033 854 7.44
C# naot #4 9.81 32.95—33.06 743,510 854 26.94
C#

.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# naot

.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