/mobile Handheld Friendly website
x64 Ubuntu : Intel® Q6600® one core |
This chart shows 3 comparisons - Time-used, Memory-used and Code-used ~ speed and size.
Each chart bar shows, for one unidentified benchmark, how much the fastest C GNU gcc program used compared to the fastest C++ GNU g++ program.
Look at speed another way - look at a box plot of Time-used data.
This table shows 3 comparisons - Time-used, Memory-used and Code-used ~ speed and size.
Each table row shows, for one named benchmark, how much the fastest C GNU gcc program used compared to the fastest C++ GNU g++ program.
| C GNU gcc used what fraction? used how many times more? | ||||
|---|---|---|---|---|
| Benchmark | Time | Memory | Code | |
| regex-dna | 1/3 | 4× | ± | |
| binary-trees | ± | 1/2 | ± | |
| fasta-redux | ± | 1/3 | ± | |
| fasta | ± | ± | ± | |
| mandelbrot | ± | ± | ± | |
| fannkuch-redux | ± | 1/3 | ± | |
| pidigits | ± | 1/2 | ± | |
| reverse-complement | ± | 2× | ± | |
| spectral-norm | ± | ± | ± | |
| n-body | ± | ± | ± | |
| k-nucleotide | 4× | ± | ± | |
| C GNU gcc used what fraction? used how many times more? | |||||||
|---|---|---|---|---|---|---|---|
| Time-used | |- | |--- | 25% | median | 75% | ---| | -| |
| (Elapsed secs) | 1/3 | 1/2 | ± | ± | ± | ± | 4× |
± read the measurements and then read the program source code.
This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ≈ CPU Load ~ speed and size.
For each named benchmark, measurements of the fastest C GNU gcc program are shown for comparison against measurements of the fastest C++ GNU g++ program.
| Program Source Code | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| regex-dna | |||||
| C GNU gcc | 5.37 | 5.38 | 326,032 | 2579 | 1% 1% 5% 100% |
| C++ GNU g++ | 15.65 | 15.66 | 91,144 | 1759 | 0% 0% 0% 100% |
| binary-trees | |||||
| C GNU gcc | 11.97 | 11.98 | 149,144 | 850 | 0% 0% 0% 100% |
| C++ GNU g++ | 16.09 | 16.15 | 296,228 | 892 | 0% 0% 0% 100% |
| fasta-redux | |||||
| C GNU gcc | 1.68 | 1.68 | 328 | 1321 | 0% 1% 0% 100% |
| C++ GNU g++ | 2.00 | 2.00 | 1,004 | 1474 | 0% 1% 0% 100% |
| fasta | |||||
| C GNU gcc | 5.84 | 5.85 | 328 | 1221 | 0% 0% 0% 100% |
| C++ GNU g++ | 6.19 | 6.20 | 328 | 1266 | 0% 0% 0% 100% |
| mandelbrot | |||||
| C GNU gcc | 23.46 | 23.47 | 30,232 | 799 | 0% 0% 0% 100% |
| C++ GNU g++ | 24.29 | 24.29 | 32,228 | 1017 | 0% 0% 0% 100% |
| fannkuch-redux | |||||
| C GNU gcc | 49.50 | 49.52 | 368 | 1557 | 0% 0% 0% 100% |
| C++ GNU g++ | 50.36 | 50.37 | 1,164 | 1440 | 0% 0% 0% 100% |
| pidigits | |||||
| C GNU gcc | 2.29 | 2.29 | 896 | 541 | 0% 0% 0% 100% |
| C++ GNU g++ | 2.29 | 2.29 | 1,580 | 682 | 0% 0% 0% 100% |
| reverse-complement | |||||
| C GNU gcc | 0.90 | 0.92 | 480,332 | 1867 | 0% 1% 0% 99% |
| C++ GNU g++ | 0.88 | 0.89 | 224,672 | 2275 | 4% 1% 1% 98% |
| spectral-norm | |||||
| C GNU gcc | 10.63 | 10.64 | 688 | 1139 | 0% 0% 0% 100% |
| C++ GNU g++ | 10.00 | 10.00 | 688 | 1044 | 1% 0% 0% 100% |
| n-body | |||||
| C GNU gcc | 20.72 | 20.72 | 328 | 1429 | 0% 0% 0% 100% |
| C++ GNU g++ | 19.35 | 19.35 | 352 | 1659 | 0% 0% 0% 100% |
| k-nucleotide | |||||
| C GNU gcc | 40.30 | 40.32 | 180,308 | 2280 | 0% 0% 0% 100% |
| C++ GNU g++ | 9.91 | 9.93 | 142,084 | 3415 | 0% 0% 0% 100% |
Remember - those are just the fastest C GNU gcc and C++ GNU g++ programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for C GNU gcc.
Maybe one of those other C GNU gcc programs is fastest on a different OS/machine.
Remember - those are just the fastest C GNU gcc and C++ GNU g++ 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.
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
Online book: The C Book
Home Page: http://gcc.gnu.org/
Download: ftp://ftp.gnu.org/pub/gnu/gcc/