The Computer Language
22.05 Benchmarks Game

Fastest cpu secs F# .NET versus C# .NET

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 cpu seconds, less gz source code.

fannkuch-redux
source mem gz cpu
C# .NET #8 33,148 1473 8.28
F# .NET #6 32,752 1097 33.86
C# .NET #9 32,836 1225 34.63
C# .NET #6 32,152 1068 39.27
F# .NET #5 37,736 912 41.06
C# .NET #7   Bad Output  
n-body
source mem gz cpu
C# .NET #9 33,528 2467 3.17
C# .NET #4 33,456 2125 3.83
C# .NET #7 33,644 1704 4.78
C# .NET #6 33,932 1742 4.80
F# .NET #6 37,180 1383 4.99
F# .NET #5 37,244 1351 6.31
F# .NET #3 35,620 1617 6.84
C# .NET #3 34,000 1305 6.90
F# .NET #4 34,136 1290 6.91
C# .NET #2 33,984 1343 7.03
C# .NET #8 33,996 1332 7.03
F# .NET #2 37,376 1381 7.22
F# .NET   Bad Output  
spectral-norm
source mem gz cpu
C# .NET #5 35,524 764 2.97
C# .NET #3 33,368 878 5.78
F# .NET #2 33,212 853 5.80
F# .NET #4 34,468 732 5.80
mandelbrot
source mem gz cpu
C# .NET 66,656 1974 12.16
C# .NET #9 66,528 816 12.17
F# .NET #6 66,476 933 14.65
F# .NET #5 66,724 897 15.54
F# .NET 66,700 877 15.67
C# .NET #5 64,376 839 16.15
pidigits
source mem gz cpu
C# .NET #6 33,768 1168 0.78
F# .NET #6 34,380 905 0.80
C# .NET #5 35,888 977 0.83
C# .NET #4 32,828 1121 1.27
F# .NET #4 35,412 874 1.28
C# .NET #7 53,276 567 8.41
regex-redux
source mem gz cpu
C# .NET #8 319,484 1869 2.65
F# .NET #7 1,219,132 599 5.82
F# .NET #6 1,061,172 611 7.26
C# .NET #5 1,061,452 673 7.45
fasta
source mem gz cpu
F# .NET #3 79,888 1350 4.13
C# .NET #5 85,788 1691 4.43
C# .NET 51,376 2098 5.16
F# .NET #4 57,276 1342 5.84
k-nucleotide
source mem gz cpu
C# .NET 185,200 2044 10.97
F# .NET #6 183,708 1907 12.55
C# .NET #6 180,876 1603 15.87
F# .NET #2 198,604 1926 16.92
reverse-complement
source mem gz cpu
C# .NET #8 930,564 2637 1.25
C# .NET #6 1,029,352 1621 3.79
C# .NET #5 1,032,176 1613 4.02
F# .NET #5 1,030,932 1140 4.29
F# .NET #4 1,030,720 1139 4.43
C# .NET #7 979,712 1310 5.13
binary-trees
source mem gz cpu
C# .NET #7 1,609,712 694 15.29
C# .NET #3 1,964,552 676 15.35
F# .NET #7 1,398,648 516 15.62
C# .NET #2 1,475,276 705 15.77
C# .NET 1,691,664 657 16.14
F# .NET

.NET SDK 6.0.101
Host Version: 6.0.1;
Commit: 3a25a7f1cc
<ServerGarbageCollection>true

C# .NET

.NET SDK 6.0.101
Host Version: 6.0.1;
Commit: 3a25a7f1cc
<ServerGarbageCollection>true