C++ Doesn't Change The Speed Of GCC
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."
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."
26 Comments