The Computer Language
Benchmarks Game

C# .NET versus F# .NET fastest programs

Always look at the source code.

These are only the fastest programs. Do some of them use manually vectorized SIMD? Look at the other programs. They may seem more-like a fair comparison to you.

regex-redux
source secs mem gz busy cpu load
C# .NET 1.42 280,892 1869 2.69 30% 39% 86% 35%
F# .NET 2.85 1,301,192 611 7.36 51% 92% 59% 56%
spectral-norm
source secs mem gz busy cpu load
C# .NET 0.82 35,048 764 2.99 89% 96% 89% 89%
F# .NET 1.55 31,916 853 5.83 92% 98% 93% 93%
binary-trees
source secs mem gz busy cpu load
C# .NET 4.81 1,881,564 676 15.47 81% 74% 83% 83%
F# .NET 6.06 1,469,616 516 16.18 63% 69% 62% 72%
mandelbrot
source secs mem gz busy cpu load
C# .NET 3.14 64,940 1974 12.30 99% 98% 97% 97%
F# .NET 3.77 64,912 933 14.73 99% 97% 98% 97%
k-nucleotide
source secs mem gz busy cpu load
C# .NET 3.29 182,860 2044 11.20 99% 86% 66% 90%
F# .NET 3.65 184,680 1907 12.58 94% 84% 85% 83%
n-body
source secs mem gz busy cpu load
C# .NET 4.83 32,756 1704 4.85 0% 0% 0% 100%
F# .NET 5.07 35,072 1383 5.18 1% 99% 1% 1%
fannkuch-redux
source secs mem gz busy cpu load
C# .NET 8.40 30,848 1225 33.29 99% 100% 99% 99%
F# .NET 8.65 31,784 1097 33.57 98% 99% 94% 98%
reverse-complement
source secs mem gz busy cpu load
C# .NET 1.50 950,648 1310 4.29 93% 63% 93% 38%
F# .NET 1.51 1,030,852 1140 4.19 93% 36% 58% 91%
fasta
source secs mem gz busy cpu load
C# .NET 1.21 152,684 1691 4.58 96% 97% 92% 93%
F# .NET 1.14 120,528 1350 4.18 94% 94% 89% 91%
pidigits
source secs mem gz busy cpu load
C# .NET 0.92 35,404 977 0.96 98% 3% 2% 1%
F# .NET 0.82 34,428 905 0.83 1% 2% 96% 1%
C# .NET

.NET SDK 5.0.201
Host Version: 5.0.4; Commit: f27d337295
<ServerGarbageCollection>true</ServerGarbageCollection>

F# .NET

.NET SDK 5.0.100
Host Version: 5.0.0; Commit: cf258a14b7
<ServerGarbageCollection>true</ServerGarbageCollection>