The Computer Language
Benchmarks Game

Haskell GHC programs versus C++ g++

by benchmark task performance

fannkuch-redux
source secs mem gz cpu cpu load
Haskell GHC 15.50 7,972 1110 60.67 96% 100% 98% 99%
C++ g++ 10.35 2,624 980 40.60 99% 99% 100% 95%
spectral-norm
source secs mem gz cpu cpu load
Haskell GHC 4.05 7,800 987 15.70 100% 94% 97% 97%
C++ g++ 1.99 1,880 1044 7.89 100% 99% 99% 99%
reverse-complement
source secs mem gz cpu cpu load
Haskell GHC 1.29 133,992 999 1.36 5% 100% 4% 5%
C++ g++ 0.60 211,852 2275 0.98 38% 25% 82% 27%
n-body
source secs mem gz cpu cpu load
Haskell GHC 21.45 9,988 1874 84.61 99% 99% 98% 100%
C++ g++ 9.31 1,052 1544 9.30 1% 1% 1% 100%
k-nucleotide
source secs mem gz cpu cpu load
Haskell GHC 32.33 643,572 1463 124.08 97% 95% 95% 98%
C++ g++ 7.18 164,052 1252 24.28 83% 83% 93% 83%
mandelbrot
source secs mem gz cpu cpu load
Haskell GHC 11.95 42,008 782 47.64 100% 100% 100% 100%
C++ g++ 1.73 34,064 1002 6.80 98% 98% 98% 99%
fasta
source secs mem gz cpu cpu load
Haskell GHC 13.70 473,972 1296 45.44 98% 80% 79% 78%
C++ g++ 1.48 4,176 2313 5.25 89% 90% 88% 89%
binary-trees
source secs mem gz cpu cpu load
Haskell GHC 25.26 673,076 494 52.88 43% 93% 38% 38%
C++ g++ 2.36 114,404 809 7.69 86% 71% 87% 85%
pidigits
source secs mem gz cpu cpu load
Haskell GHC   Make Error
C++ g++ 0.07 ? 508 0.07 0% 0% 89% 0%
regex-redux
source secs mem gz cpu cpu load
Haskell GHC   Bad Output
C++ g++ 0.21 1,540 853 0.27 9% 5% 77% 64%
Haskell GHC

The Glorious Glasgow Haskell Compilation System, version 8.2.1

C++ g++

g++ (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406