C++ Doesn't Change The Speed Of GCC

Written by Michael Larabel in GNU on 22 March 2013 at 12:29 PM EDT. 26 Comments
GNU
With GCC 4.8 using C++ as its implementation language of the compiler, some have questioned whether the compiler is as fast as when written in C. Here's some benchmarks showing C vs. C++ performance with GCC.

Google's Ian Taylor, a GCC expert, has claimed the C subset of C++ is just as far as the native C implementation. Meanwhile, Rusty Russell decided to question these claims so he ran his own tests when building GCC 4.7.2 in C and C++ modes. After building the GNU Compiler Collection both ways, he compared the performance of the resulting compilers when building the Linux kernel ten times.

The result? The C++ binary is slightly larger due to more debugging information, but the compile time is about the same. Rusty ended his blog post with "so whether you like C++ or not, the performance argument is moot."
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week