vs

 1 : Are the C gcc programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest C gcc program used compared to the fastest Haskell GHC 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 C gcc programs faster? Approximately.

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

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

 C gcc used what fraction? used how many times more? 
Benchmark Time Memory Code
 binary-trees1/61/5±
 regex-dna1/4±
 reverse-complement †1/3±
 mandelbrot1/2 ±
 n-body1/2 ±
 fasta †1/2 
 spectral-norm1/2 1/2
 pidigits †1/2 ±
 k-nucleotide1/21/2±
 fannkuch-redux± 
 C gcc used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/61/61/31/21/2±±

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

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

 3 : Are the C gcc 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 C gcc program are shown for comparison against measurements of the fastest Haskell GHC program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 binary-trees 
C gcc10.373.33155,504906  79% 62% 74% 99%
Haskell GHC64.7320.18813,620612  74% 74% 99% 74%
 regex-dna 
C gcc5.812.44305,4882579  60% 51% 80% 52%
Haskell GHC35.699.52250,0081518  93% 91% 96% 96%
 reverse-complement 
C gcc0.770.51250,784741  21% 18% 74% 43% †
Haskell GHC1.551.38126,340999  99% 4% 4% 4% †
 mandelbrot 
C gcc19.445.0231,928694  96% 96% 100% 96%
Haskell GHC45.8111.4937,116782  100% 100% 100% 100%
 n-body 
C gcc10.1910.194361490  0% 1% 1% 100%
Haskell GHC24.3523.172,7281874  2% 3% 100% 2%
 fasta 
C gcc5.721.945,0401914  89% 99% 63% 47% †
Haskell GHC4.494.022,732979  5% 6% 100% 5% †
 spectral-norm 
C gcc7.891.98752569  99% 99% 100% 100%
Haskell GHC15.704.041,940984  97% 97% 97% 97%
 pidigits 
C gcc1.731.73932448  1% 1% 3% 100% †
Haskell GHC3.982.716,212341  17% 16% 100% 17% †
 k-nucleotide 
C gcc35.0911.37188,4962280  64% 91% 61% 94%
Haskell GHC65.9917.73363,7801693  92% 93% 93% 97%
 fannkuch-redux 
C gcc55.4814.254281557  98% 96% 96% 100%
Haskell GHC63.3916.154,036834  99% 100% 100% 94%
 fasta-redux 
C gcc0.020.02?1402  0% 0% 0% 100%
No program

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

 4 : Are there other C gcc programs for these benchmarks?

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

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

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest C gcc and Haskell GHC 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.

 C gcc : unchecked low-level programming 

gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

Online book: The C Book

Online book: Looking for 4x speedups? SSE to the rescue! pdf slides

Home Page: http://gcc.gnu.org/

Download: ftp://ftp.gnu.org/pub/gnu/gcc/

Revised BSD license

  Home   Conclusions   License   Play