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

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 : Approximately - Are the Haskell GHC programs faster?

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±
 binary-trees±
 k-nucleotide
 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 : Measurements - Are the Haskell GHC programs faster?

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.342.1115,5321550  44% 21% 44% 50% †
C++ g++2.902.911,1761543  100% 1% 0% 0% †
 fannkuch-redux 
Haskell GHC54.3613.893,4241153  98% 98% 100% 95%
C++ g++50.9313.021,4121440  100% 94% 99% 100%
 pidigits 
Haskell GHC4.913.4812,272341  100% 14% 15% 14% †
C++ g++2.682.693,076682  0% 1% 2% 100% †
 reverse-complement 
Haskell GHC1.561.46134,216999  2% 100% 3% 2% †
C++ g++1.170.78247,3402275  23% 87% 11% 47% †
 spectral-norm 
Haskell GHC16.084.151,392984  95% 97% 99% 97%
C++ g++7.962.002,0241044  100% 100% 100% 100%
 mandelbrot 
Haskell GHC55.7313.9734,212782  100% 100% 100% 100%
C++ g++22.975.7733,5921017  99% 99% 99% 100%
 regex-dna 
Haskell GHC39.4410.41208,9641518  97% 97% 93% 93%
C++ g++5.574.02176,492695  2% 63% 75% 1%
 binary-trees 
Haskell GHC40.4113.66405,572612  67% 99% 67% 66%
C++ g++16.575.08180,752892  81% 85% 82% 83%
 k-nucleotide 
Haskell GHC76.8120.49268,8201965  97% 93% 94% 92%
C++ g++23.607.22132,7401252  78% 77% 76% 98%
 n-body 
Haskell GHC27.1026.373,6441874  100% 2% 1% 2%
C++ g++9.129.138761545  0% 0% 100% 1%
 fasta-redux 
No program
C++ g++0.030.03?1474  0% 0% 0% 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.4

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

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

Revised BSD license

  Home   Conclusions   License   Play