News for hackers. Stuff that matters.
Re:GCC and C vs C++ Speed, Measured by adamnemecek on Thursday March 21, 2013 @04:20AM (#5413720)
That is one hell of a misnamed article.
Re:GCC and C vs C++ Speed, Measured by dbaupp on Thursday March 21, 2013 @04:29AM (#5413743)
Why? It is measuring the difference between a compiled-as-C GCC and a compiled-as-C++ GCC.
Re:GCC and C vs C++ Speed, Measured by easytiger on Thursday March 21, 2013 @05:41AM (#5413934)
i think the point is largely it is irrelevant. people care abut the speed of their process, not the time it took to generate (within reason)
Re:GCC and C vs C++ Speed, Measured by caf on Thursday March 21, 2013 @05:56AM (#5413970)
In this case the process is "GCC" and the way to measure its speed to measure how long it takes to compile something else.
Re:GCC and C vs C++ Speed, Measured by easytiger on Thursday March 21, 2013 @11:41AM (#5415821)
yes but the point was the title is ambiguous because almost all people will care about the speed of the binary it outputs not it itself. Indeed that is something people spend a lot of time on
Re:GCC and C vs C++ Speed, Measured by adamnemecek on Thursday March 21, 2013 @04:34AM (#5413752)
Difference in compilation times.
Re:GCC and C vs C++ Speed, Measured by caf on Thursday March 21, 2013 @04:42AM (#5413774)
It's measuring the speed of the GCC-compiled-as-C compiler against the GCC-compiled-as-C++ compiler by measuring how long each of those takes to compile the Linux kernel. It's not measuring how long it took to compile GCC itself.
Re:GCC and C vs C++ Speed, Measured by RustyRussell on Thursday March 21, 2013 @04:45AM (#5413785)
Yeah, people seem confused by this. You can build the last release of gcc either with a C++ compiler or with a C compiler. I did both, and benchmarked the results.

Hope that helps! Rusty.

Re:GCC and C vs C++ Speed, Measured by adamnemecek on Thursday March 21, 2013 @05:00AM (#5413830)
Sorry, I missed the sentence: "With this in mind, and Ian Taylor’s bold assertion that "The C subset of C++ is as efficient as C", I wanted to test what had changed with some actual measurements."
Re:GCC and C vs C++ Speed, Measured by masklinn on Thursday March 21, 2013 @04:48AM (#5413796)
To test a compiler's performances, you use it to compile stuff don't you? That's what TFA does: it builds GCC 4.7 using both a C compiler and a C++ compiler, then looks how the results perform, by compiling stuff with them.

TFA did not bench how long the original compilation (whether through C or through C++) took, that would have been pointless and irrelevant.

Re:GCC and C vs C++ Speed, Measured by capisce on Thursday March 21, 2013 @04:35AM (#5413754)
Which is indicative of performance.
Re:GCC and C vs C++ Speed, Measured by adamnemecek on Thursday March 21, 2013 @04:48AM (#5413793)
But isn't GCC still written mostly in C? So would not both gcc versions be expected to be very similar on instruction level?
Re:GCC and C vs C++ Speed, Measured by masklinn on Thursday March 21, 2013 @04:51AM (#5413802)
> So would not both gcc versions be expected to be very similar on instruction level?

It's going to go through the g++ frontend, parsing and compiling it using C++ semantics. There's no guarantee that the C subset of C++ will yield the exact same result as that of an actual C compiler. And a decade or two ago, as TFA notes, it most definitely did not.

Re:GCC and C vs C++ Speed, Measured by adamnemecek on Thursday March 21, 2013 @05:14AM (#5413865)
I guess I just assumed that considering that both compilers are part of the same compiler collection that their output, while not guaranteed to be the same, can be expected to be somewhat similar. And that the divergences should not have all that much of an impact on execution speed. But I guess I did jump to a conclusion there.
Re:GCC and C vs C++ Speed, Measured by masklinn on Thursday March 21, 2013 @07:09AM (#5414240)
The backend should do the same thing, but if the C++ frontend gives complete garbage to the backend, I guess there's only so much the backend can do to fix the mess.