The article is about the runtime difference. In this case, the "run" is using gcc's compiled in both languages (via gcc and g++) to build the Linux kernel. Both gcc's show about the same runtime performance when executing this task.
I can see how this is a little confusing but it shouldn't be that hard. And yet there have been hours of comments on this story that miss this point.
"AND the optimizations available to a C++ compiler (even if it was targeting the C subset). I wish the article gave some information about the runtime difference."
To be absolutely explicit, because I realize my phrase wasn't clear, I was under the impression that C++ optimizations were expensive (say, under -O3 or -Os), so I wish that the same test were run under -O3 or -Os (comparing both the speed of compilation AND the optimizations)
> I was under the impression that C++ optimizations were expensive (say, under -O3 or -Os), so I wish that the same test were run under -O3 or -Os (comparing both the speed of compilation AND the optimizations)
What optimizations are available to the C subset of C++ that are not also available to C? The only thing I can think of offhand which would make compilation of C-with-C++ slower is the difference in symbol naming.
From what I understand of GCC, once the compilation has progressed to the optimization stage the code has already been converted to an intermediate language so the source frontend (gcc or g++) should not necessarily make available extra optimization passes. Again, this is speaking strictly of the subset of C which is common to both C and C++.
> What optimizations are available to the C subset of C++ that are not also available to C?
I thought C++ had some stricter rules about aliasing, allowing more room for optimization of the same code, but I'm having trouble finding out exactly what the difference was.
I actually haven't done a comprehensive test yet, but with debugging symbols turned off, are the same set of optimizations performed in gcc and in g++ compiling C code ?
The answer to that question probably depends on what optimization passes are in the language frontend (as opposed to the language-agnostic backend).
Of course, it's possible that some backend optimizations require proper annotations to be placed by the frontend. Either way though the GCC guys have been pretty good with their C support so I'd be very surprised if the C frontend didn't have the superior optimizer (if they are actually different on their support for the C subset supported by C and C++).
I can see how this is a little confusing but it shouldn't be that hard. And yet there have been hours of comments on this story that miss this point.