1 : Are the Haskell GHC programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest Haskell GHC program used compared to the fastest C++ g++ program.

(Memory use is only compared for tasks that require memory to be allocated.)


These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.

 2 : Are the Haskell GHC programs faster? Approximately.

Each table row shows, for one named benchmark, how much the fastest Haskell GHC program used compared to the fastest C++ g++ program.

(Memory use is only compared for tasks that require memory to be allocated.)

 Haskell GHC used what fraction? used how many times more? 
Benchmark Time Memory Code
 fasta± ±
 fannkuch-redux± ±
 pidigits †± 1/2
 reverse-complement †1/21/2
 spectral-norm ±
 mandelbrot ±
 regex-dna±
 k-nucleotide
 binary-trees±
 n-body ±
 Haskell GHC used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±±

† possible mismatch - one-core program compared to multi-core program.

± read the measurements and then read the program source code.

 3 : Are the Haskell GHC programs faster? Measurements.

These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.

For each named benchmark, measurements of the fastest Haskell GHC program are shown for comparison against measurements of the fastest C++ g++ program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 fasta 
Haskell GHC3.943.662,464979  4% 100% 3% 4%
C++ g++4.214.228721286  0% 100% 0% 1%
 fannkuch-redux 
Haskell GHC64.4516.433,4521153  100% 100% 99% 94%
C++ g++50.0312.881,0361440  99% 99% 100% 99%
 pidigits 
Haskell GHC4.953.496,152341  14% 15% 100% 13% †
C++ g++2.682.681,452682  0% 0% 1% 100% †
 reverse-complement 
Haskell GHC1.541.45125,956999  3% 6% 4% 100% †
C++ g++1.150.75247,0082275  11% 87% 30% 29% †
 spectral-norm 
Haskell GHC15.704.041,420984  97% 97% 97% 98%
C++ g++7.972.009241044  100% 100% 100% 100%
 mandelbrot 
Haskell GHC48.0612.0433,272782  100% 100% 100% 100%
C++ g++23.465.8932,1801017  100% 100% 100% 100%
 regex-dna 
Haskell GHC33.458.76200,3921518  96% 93% 96% 98%
C++ g++5.383.83171,652695  1% 65% 76% 2%
 k-nucleotide 
Haskell GHC70.5319.10260,1881965  91% 91% 91% 98%
C++ g++23.447.22139,1361252  76% 76% 78% 97%
 binary-trees 
Haskell GHC40.3313.56398,172612  66% 67% 100% 66%
C++ g++15.895.05179,668892  73% 70% 97% 77%
 n-body 
Haskell GHC25.0024.402,1921874  1% 1% 100% 1%
C++ g++9.089.093361544  0% 100% 1% 0%
 fasta-redux 
No program
C++ g++0.030.03?1474  0% 0% 25% 100%

† possible mismatch - one-core program compared to multi-core program.

 4 : Are there other Haskell GHC programs for these benchmarks?

Remember - those are just the fastest Haskell GHC and C++ g++ programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Haskell GHC.

Maybe one of those other Haskell GHC programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Haskell GHC and C++ g++ programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.

Maybe one of those other programs is fastest on a different OS/machine.

 Haskell GHC : lazy pure functional programming 

The Glorious Glasgow Haskell Compilation System, version 7.8.2

Home Page: http://www.haskell.org/

Download: http://www.haskell.org/ghc/

Revised BSD license

  Home   Conclusions   License   Play