The Computer Language
Benchmarks Game

Haskell GHC versus F# .NET Core fastest programs

Back in April 2010, Russ Cox charitably suggested that only fannkuch-redux, fasta, k-nucleotide, mandlebrot, nbody, reverse-complement and spectral-norm were close to fair comparisons. As someone who implemented programming languages, his interest was "measuring the quality of the generated code when both compilers are presented with what amounts to the same program."

Differences in approach - to memory management, parallel programming, regex, arbitrary precision arithmetic, implementation technique - don't fit in that kind-of fair comparison — but we still have to deal with them.

These are only the fastest programs. There may be additional measurements for programs which seem more-like a fair comparison to you. Always look at the source code.

regex-redux
source secs mem gz busy cpu load
Haskell GHC 1.72 307,968 2213 3.77 78% 40% 61% 40%
F# .NET Core 17.16 1,341,200 611 54.97 78% 78% 75% 89%
fasta
source secs mem gz busy cpu load
Haskell GHC 1.43 7,900 1882 4.25 76% 76% 73% 73%
F# .NET Core 1.70 107,124 1350 6.41 93% 99% 94% 92%
n-body
source secs mem gz busy cpu load
Haskell GHC 21.87 4,232 1883 86.49 100% 99% 98% 99%
F# .NET Core 22.76 36,616 1381 23.42 100% 1% 2% 1%
spectral-norm
source secs mem gz busy cpu load
Haskell GHC 4.08 4,060 987 15.82 97% 97% 97% 97%
F# .NET Core 4.21 34,304 853 16.04 98% 94% 94% 95%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 18.37 4,296 842 72.64 100% 100% 96% 100%
F# .NET Core 16.75 34,468 949 64.96 98% 97% 99% 95%
pidigits
source secs mem gz busy cpu load
Haskell GHC 4.21 9,296 379 5.24 9% 100% 8% 8%
F# .NET Core 3.14 36,608 874 3.24 2% 98% 2% 1%
mandelbrot
source secs mem gz busy cpu load
Haskell GHC 11.65 39,512 782 46.54 100% 100% 100% 100%
F# .NET Core 6.47 65,488 897 25.26 97% 100% 97% 97%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 13.34 466,176 592 49.53 95% 93% 92% 91%
F# .NET Core 6.99 918,992 631 24.34 88% 89% 86% 86%
reverse-complement
source secs mem gz busy cpu load
Haskell GHC 6.28 501,496 1020 8.42 11% 11% 11% 100%
F# .NET Core 2.94 1,031,376 1140 8.33 54% 37% 95% 97%
k-nucleotide
source secs mem gz busy cpu load
Haskell GHC 37.65 756,564 1486 132.24 87% 86% 87% 91%
F# .NET Core 5.97 183,292 1907 19.71 92% 72% 84% 83%
Haskell GHC

The Glorious Glasgow Haskell Compilation System,
version 8.8.1

F# .NET Core

Microsoft (R) F# Compiler version 10.6.0.0 for F# 4.7
.NET Core SDK 3.0.100
Host Version: 3.0.0; Commit: 95a0a61858
<ServerGarbageCollection>true
<ConcurrentGarbageCollection>true