The Computer Language
Benchmarks Game

Haskell GHC programs versus C++ g++

by benchmark task performance

reverse-complement
source secs mem gz cpu cpu load
Haskell GHC 1.30 128,364 999 1.30 2% 2% 1% 99%
C++ g++ 1.02 247,604 2275 1.01 2% 0% 0% 100%
fannkuch-redux
source secs mem gz cpu cpu load
Haskell GHC 56.93 3,232 1153 56.90 0% 2% 1% 100%
C++ g++ 24.65 556 1150 24.64 1% 1% 0% 100%
spectral-norm
source secs mem gz cpu cpu load
Haskell GHC 18.81 2,336 987 18.80 3% 1% 0% 100%
C++ g++ 7.93 2,288 1044 7.92 1% 1% 0% 100%
binary-trees
source secs mem gz cpu cpu load
Haskell GHC 16.98 190,168 612 16.95 0% 0% 1% 100%
C++ g++ 6.86 76,616 846 6.85 0% 1% 0% 100%
n-body
source secs mem gz cpu cpu load
Haskell GHC 30.44 3,500 1874 30.42 1% 1% 0% 100%
C++ g++ 8.96 816 1545 8.95 1% 1% 0% 100%
fasta
source secs mem gz cpu cpu load
Haskell GHC 23.41 399,264 1296 23.39 0% 1% 1% 100%
C++ g++ 4.21 1,336 1105 4.20 1% 1% 0% 100%
k-nucleotide
source secs mem gz cpu cpu load
Haskell GHC 139.13 492,368 1052 136.78 0% 1% 1% 100%
C++ g++ 24.04 137,908 1252 23.98 1% 1% 0% 100%
pidigits
source secs mem gz cpu cpu load
Haskell GHC   Make Error
C++ g++ 0.09 ? 508 0.09 0% 0% 10% 100%
mandelbrot
source secs mem gz cpu cpu load
Haskell GHC   Bad Output
C++ g++ 0.09 ? 726 0.09 0% 0% 10% 100%
Haskell GHC

The Glorious Glasgow Haskell Compilation System, version 8.0.1

C++ g++

g++ (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609