/mobile Handheld Friendly website

vs

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

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

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

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

 C++ g++ used what fraction? used how many times more? 
Benchmark Time Memory Code
 binary-trees1/3±±
 k-nucleotide1/2±1/2
 fasta± ±
 n-body± ±
 regex-dna±1/21/4
 fannkuch-redux± ±
 spectral-norm± 
 mandelbrot± ±
 pidigits± 
 fasta-redux± ±
 reverse-complement±±
 C++ g++ used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/31/2±±±±±

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

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

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 binary-trees 
C++ g++10.4210.4366,996919  0% 1% 1% 100%
C gcc34.1634.1866,096706  0% 0% 1% 100%
 k-nucleotide 
C++ g++24.0324.04138,9601252  1% 1% 0% 100%
C gcc38.0938.12153,4162280  1% 1% 0% 100%
 fasta 
C++ g++4.224.228721286  1% 1% 0% 100%
C gcc5.045.052841221  1% 0% 1% 100%
 n-body 
C++ g++9.089.083361544  0% 0% 1% 100%
C gcc9.919.923361490  0% 1% 1% 100%
 regex-dna 
C++ g++5.335.34170,488695  0% 0% 1% 100%
C gcc5.375.38288,9842579  1% 1% 0% 100%
 fannkuch-redux 
C++ g++27.2227.232841150  0% 1% 1% 100%
C gcc27.2627.273161183  0% 0% 1% 100%
 spectral-norm 
C++ g++7.927.939241044  0% 1% 1% 100%
C gcc7.857.85644569  0% 0% 1% 100%
 mandelbrot 
C++ g++23.4423.4532,1801017  0% 1% 1% 100%
C gcc22.5922.6030,848799  1% 0% 1% 100%
 pidigits 
C++ g++2.682.681,452682  0% 1% 4% 100%
C gcc2.492.49856448  0% 1% 0% 100%
 fasta-redux 
C++ g++2.162.176201474  0% 2% 0% 100%
C gcc1.671.672841321  1% 1% 0% 100%
 reverse-complement 
C++ g++0.980.99245,6922275  3% 1% 0% 99%
C gcc0.740.75250,408741  1% 1% 0% 100%

 4 : Are there other C++ g++ programs for these benchmarks?

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

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

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest C++ g++ and C gcc 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++ g++ : c plus objects plus generics 

C++ 1991-2006, Bjarne Stroustrup (pdf)

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

gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

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

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

Revised BSD license

  Home   Conclusions   License   Play