The Computer Language
23.02 Benchmarks Game

F# .NET versus C# .NET fastest performance

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# .NET #8 2.18 104,872 1473 8.37
C# .NET #9 8.10 106,224 1225 31.95
F# .NET #6 8.33 106,496 1097 32.25
C# .NET #6 9.23 104,932 1068 36.47
F# .NET #5 9.75 111,368 912 38.19
C# .NET #7   Bad Output  
n-body
source secs mem gz cpu secs
C# .NET #9 3.18 104,576 2467 3.16
C# .NET #4 3.82 104,476 2125 3.80
C# .NET #7 4.83 104,640 1704 4.81
C# .NET #6 4.84 104,620 1742 4.83
F# .NET #6 5.02 108,192 1383 5.00
F# .NET #3 6.91 106,624 1617 6.90
C# .NET #3 6.93 104,984 1305 6.90
C# .NET #8 7.16 105,044 1332 7.15
C# .NET #2 7.17 104,984 1343 7.15
F# .NET #2 7.28 108,408 1381 7.26
F# .NET #4 7.40 108,620 1290 7.38
F# .NET #5 7.47 108,388 1351 7.45
F# .NET   Bad Output  
spectral-norm
source secs mem gz cpu secs
C# .NET #5 0.94 109,316 764 3.30
F# .NET #4 1.60 110,572 732 5.86
C# .NET #3 1.59 107,244 878 5.88
F# .NET #2 1.63 109,184 853 5.90
mandelbrot
source secs mem gz cpu secs
C# .NET 3.20 139,968 1974 12.39
C# .NET #9 3.20 140,004 816 12.40
F# .NET #6 3.83 140,068 933 14.86
F# .NET 4.08 140,580 877 15.88
F# .NET #5 4.09 139,916 897 15.90
C# .NET #5 4.15 137,620 839 16.15
pidigits
source secs mem gz cpu secs
C# .NET #6 0.98 106,388 1168 0.97
C# .NET #5 0.97 108,208 977 0.97
F# .NET #6 0.99 105,584 905 0.98
C# .NET #4 1.38 106,156 1121 1.37
F# .NET #4 1.39 106,688 874 1.39
C# .NET #7 6.71 127,392 567 7.28
regex-redux
source secs mem gz cpu secs
C# .NET #8 1.48 463,764 1869 2.71
F# .NET #6 2.45 1,131,324 611 5.76
C# .NET #5 2.62 1,131,296 673 5.84
F# .NET #7 4.66 1,325,080 599 6.52
fasta
source secs mem gz cpu secs
F# .NET #3 1.16 137,720 1350 4.13
F# .NET #4 1.29 201,344 1342 4.54
C# .NET #5 1.55 125,204 1691 5.52
C# .NET 1.65 126,308 2098 5.95
k-nucleotide
source secs mem gz cpu secs
C# .NET 3.64 258,496 2044 11.97
F# .NET #6 4.11 260,772 1907 12.92
C# .NET #6 5.95 262,512 1603 15.73
F# .NET #2 4.54 272,540 1926 15.96
reverse-complement
source secs mem gz cpu secs
C# .NET #8 0.58 996,916 2637 1.29
C# .NET #5 2.80 1,100,032 1613 3.74
C# .NET #6 1.61 1,100,936 1621 3.82
C# .NET #7 1.86 1,042,272 1310 4.94
F# .NET #4   Timed Out  
F# .NET #5   Timed Out  
binary-trees
source secs mem gz cpu secs
C# .NET #2 4.84 1,592,704 705 15.66
C# .NET #3 5.04 2,060,704 676 15.93
C# .NET #7 4.98 1,788,072 694 16.08
F# .NET #7 5.39 1,718,280 516 16.69
C# .NET 5.34 2,185,096 657 17.27
F# .NET

.NET SDK 7.0.102
Host Version: 7.0.2
Commit: d037e070eb
<ServerGarbageCollection>true

C# .NET

.NET SDK 7.0.102
Host Version: 7.0.2
Commit: d037e070eb
<ServerGarbageCollection>true