/mobile Handheld Friendly website

÷

 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.


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.

 C++ g++ used what fraction? used how many times more? 
Benchmark Time Memory Code
 k-nucleotide1/2±1/2
 fasta±±
 mandelbrot±±±
 fannkuch-redux±±
 spectral-norm±±
 pidigits±
 n-body±±
 fasta-redux±±
 reverse-complement±±
 binary-trees±
 regex-dna1/21/4
 C++ g++ used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/21/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
 k-nucleotide 
C++ g++23.397.40138,1001252  73% 74% 74% 97%
C gcc39.8814.64153,6882280  96% 92% 50% 36%
 fasta 
C++ g++4.104.116201105  55% 0% 0% 46%
C gcc4.924.932921221  0% 0% 100% 0%
 mandelbrot 
C++ g++19.645.1032,076726  95% 95% 95% 100%
C gcc23.255.8327,596799  100% 100% 100% 100%
 fannkuch-redux 
C++ g++49.7112.699961440  98% 100% 94% 100%
C gcc51.3813.073321557  96% 100% 100% 98%
 spectral-norm 
C++ g++7.962.009241044  100% 100% 100% 100%
C gcc8.022.02644569  100% 100% 100% 100%
 pidigits 
C++ g++2.682.681,452682  1% 0% 1% 99%
C gcc2.492.50864448  21% 0% 0% 80%
 n-body 
C++ g++10.5510.568681749  57% 0% 0% 43%
C gcc8.858.853361490  0% 0% 100% 1%
 fasta-redux 
C++ g++2.172.176201474  0% 0% 100% 1%
C gcc1.671.672921321  1% 0% 100% 1%
 reverse-complement 
C++ g++1.220.84245,4282275  19% 31% 12% 88%
C gcc0.920.65248,632741  17% 31% 83% 16%
 binary-trees 
C++ g++19.066.60173,960892  60% 92% 75% 65%
C gcc14.384.32103,396850  81% 90% 99% 72%
 regex-dna 
C++ g++6.084.54173,240695  1% 77% 1% 57%
C gcc6.072.69291,9642579  68% 41% 72% 48%

 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 (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3

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

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

Revised BSD license

  Home   Conclusions   License   Play