The Computer Language
Benchmarks Game

Haskell GHC versus C clang 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
Haskell GHC 1.07 345,128 2213 2.47 59% 44% 44% 83%
C clang 3.12 103,044 1115 3.14 100% 0% 1% 0%
mandelbrot
source secs mem gz busy cpu load
Haskell GHC 1.51 37,504 1975 5.98 99% 99% 99% 99%
C clang 3.49 29,608 822 13.94 100% 100% 100% 100%
binary-trees
source secs mem gz busy cpu load
Haskell GHC 5.02 449,868 811 18.05 90% 85% 93% 91%
C clang 7.69 351,340 908 27.75 92% 91% 88% 91%
pidigits
source secs mem gz busy cpu load
Haskell GHC 0.83 6,056 928 0.84 0% 99% 1% 1%
C clang 0.81 2,792 416 0.85 6% 0% 0% 99%
fannkuch-redux
source secs mem gz busy cpu load
Haskell GHC 9.95 3,764 1113 39.18 95% 100% 99% 100%
C clang 8.85 936 1557 34.65 94% 100% 98% 99%
fasta
source secs mem gz busy cpu load
Haskell GHC 0.88 7,628 1882 3.32 94% 96% 93% 93%
C clang 0.78 1,160 1463 0.79 0% 1% 100% 0%
n-body
source secs mem gz busy cpu load
Haskell GHC 6.42 4,176 1883 6.47 0% 0% 0% 100%
C clang 2.21 768 1633 2.23 0% 0% 0% 100%
spectral-norm
source secs mem gz busy cpu load
Haskell GHC 1.47 3,964 987 5.71 97% 97% 97% 97%
C clang   Make Error
reverse-complement
source secs mem gz busy cpu load
Haskell GHC   Make Error
C clang 1.07 994,176 750 1.55 15% 88% 12% 30%
k-nucleotide
source secs mem gz busy cpu load
Haskell GHC 22.02 638,132 1486 85.78 97% 99% 97% 97%
C clang   Make Error
Haskell GHC

The Glorious Glasgow Haskell Compilation System,
version 9.0.1

C clang

Ubuntu clang version 12.0.0-1ubuntu