/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® quad-core |
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.
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-nucleotide | 1/2 | ± | 1/2 | |
| fasta | ± | 2× | ± | |
| mandelbrot | ± | ± | ± | |
| fannkuch-redux | ± | 3× | ± | |
| spectral-norm | ± | ± | 2× | |
| pidigits | ± | 2× | 2× | |
| n-body | ± | 3× | ± | |
| fasta-redux | ± | 2× | ± | |
| reverse-complement | ± | ± | 3× | |
| binary-trees | 2× | 2× | ± | |
| regex-dna | 2× | 1/2 | 1/4 | |
| C++ g++ used what fraction? used how many times more? | |||||||
|---|---|---|---|---|---|---|---|
| Time-used | |- | |--- | 25% | median | 75% | ---| | -| |
| (Elapsed secs) | 1/2 | 1/2 | ± | ± | ± | 2× | 2× |
± read the measurements and then read the program source code.
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.39 | 7.40 | 138,100 | 1252 | 73% 74% 74% 97% |
| C gcc | 39.88 | 14.64 | 153,688 | 2280 | 96% 92% 50% 36% |
| fasta | |||||
| C++ g++ | 4.10 | 4.11 | 620 | 1105 | 55% 0% 0% 46% |
| C gcc | 4.92 | 4.93 | 292 | 1221 | 0% 0% 100% 0% |
| mandelbrot | |||||
| C++ g++ | 19.64 | 5.10 | 32,076 | 726 | 95% 95% 95% 100% |
| C gcc | 23.25 | 5.83 | 27,596 | 799 | 100% 100% 100% 100% |
| fannkuch-redux | |||||
| C++ g++ | 49.71 | 12.69 | 996 | 1440 | 98% 100% 94% 100% |
| C gcc | 51.38 | 13.07 | 332 | 1557 | 96% 100% 100% 98% |
| spectral-norm | |||||
| C++ g++ | 7.96 | 2.00 | 924 | 1044 | 100% 100% 100% 100% |
| C gcc | 8.02 | 2.02 | 644 | 569 | 100% 100% 100% 100% |
| pidigits | |||||
| C++ g++ | 2.68 | 2.68 | 1,452 | 682 | 1% 0% 1% 99% |
| C gcc | 2.49 | 2.50 | 864 | 448 | 21% 0% 0% 80% |
| n-body | |||||
| C++ g++ | 10.55 | 10.56 | 868 | 1749 | 57% 0% 0% 43% |
| C gcc | 8.85 | 8.85 | 336 | 1490 | 0% 0% 100% 1% |
| fasta-redux | |||||
| C++ g++ | 2.17 | 2.17 | 620 | 1474 | 0% 0% 100% 1% |
| C gcc | 1.67 | 1.67 | 292 | 1321 | 1% 0% 100% 1% |
| reverse-complement | |||||
| C++ g++ | 1.22 | 0.84 | 245,428 | 2275 | 19% 31% 12% 88% |
| C gcc | 0.92 | 0.65 | 248,632 | 741 | 17% 31% 83% 16% |
| binary-trees | |||||
| C++ g++ | 19.06 | 6.60 | 173,960 | 892 | 60% 92% 75% 65% |
| C gcc | 14.38 | 4.32 | 103,396 | 850 | 81% 90% 99% 72% |
| regex-dna | |||||
| C++ g++ | 6.08 | 4.54 | 173,240 | 695 | 1% 77% 1% 57% |
| C gcc | 6.07 | 2.69 | 291,964 | 2579 | 68% 41% 72% 48% |
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.
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++ 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/