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.
[ Parent
| on HN ]
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)
In this case the process is "GCC" and the way to measure its speed to measure how long it takes to compile something else.
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.
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."
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.
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?
> 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.