/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 Python 3 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 Python 3 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
 spectral-norm1/129 
 n-body1/108 ±
 mandelbrot1/82 ±
 fasta1/58 
 fannkuch-redux †1/37 ±
 binary-trees1/341/8±
 k-nucleotide1/221/3
 reverse-complement †1/81/3
 regex-dna1/2±±
 pidigits± 
 C++ g++ used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/1291/1291/821/351/81/3±

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

± 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 Python 3 program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 spectral-norm 
C++ g++7.962.009361044  100% 100% 100% 100%
Python 31,026.66258.4230,260437  99% 99% 99% 99%
 n-body 
C++ g++9.089.083441545  1% 0% 0% 100%
Python 3984.27984.534,2521181  0% 100% 0% 0%
 mandelbrot 
C++ g++23.475.9032,0881017  99% 99% 99% 100%
Python 31,837.41483.667,488777  100% 94% 93% 94%
 fasta 
C++ g++4.224.238841286  1% 0% 0% 100%
Python 3241.56246.324,324788  30% 24% 15% 33%
 fannkuch-redux 
C++ g++27.2827.302961150  1% 1% 1% 100% †
Python 34,000.061,012.0627,840797  99% 99% 98% 100% †
 binary-trees 
C++ g++12.244.0988,368919  70% 69% 95% 62%
Python 3526.56139.26688,512626  93% 96% 96% 94%
 k-nucleotide 
C++ g++23.317.26137,2161252  74% 97% 76% 75%
Python 3488.50161.33364,488647  89% 60% 98% 56%
 reverse-complement 
C++ g++1.220.84245,4562275  29% 33% 49% 35% †
Python 36.536.55781,144325  0% 1% 0% 100% †
 regex-dna 
C++ g++5.974.42179,480695  1% 77% 58% 1%
Python 323.8111.01248,260478  37% 72% 45% 64%
 pidigits 
C++ g++2.682.681,464682  1% 0% 2% 100%
Python 33.053.065,332256  1% 1% 0% 100%
 fasta-redux 
C++ g++0.030.03?1474  0% 0% 100% 0%
No program

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

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

Remember - those are just the fastest C++ g++ and Python 3 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 Python 3 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.1 (Ubuntu/Linaro 4.8.1-10ubuntu8)

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

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

Revised BSD license

  Home   Conclusions   License   Play