Linked by ebasconp on Fri 10th Jun 2011 22:22 UTC
Benchmarks "Google has released a research paper that suggests C++ is the best-performing programming language in the market. The internet giant implemented a compact algorithm in four languages - C++, Java, Scala and its own programming language Go - and then benchmarked results to find 'factors of difference'."
Permalink for comment 476926
To read all comments associated with this story, please click here.
RE[4]: GCC isn't all that great
by Alfman on Sat 11th Jun 2011 09:57 UTC in reply to "RE[3]: GCC isn't all that great"
Alfman
Member since:
2011-01-28

acobar,

"Well, I will repeat to you what I do to everyone I met and that would ask my advise (not your case) on programming: first look for a good, tested, implementation. Many people try to code fragments that are already optimized for ages. They don't look at Donald Knuth's ACP, fftw, lapack, atlas and many other well-thought code before they start and, as such, write subpar code."


I actually don't encourage people to optimize things at such small levels or in assembly. I'm just disturbed that so many people are under the false impression that their compilers are so difficult to beat.


"You get a pretty decent optimized code:"

Yes, I am aware that we can coerce the compiler to generate better instructions by rewriting the C code.

(Although it still isn't as good for the other reasons already discussed).

It concerns me that GCC converts our C code to assembly so literally instead of generating more optimal paths.

Should we really encourage devs to adjust thier programming style to compensate for GCC optimizer deficiency?

Does this mean that C devs will have to understand CPU internals in order to have GCC produce optimal code?

I really don't think we should be making excuses for GCC here. There is nothing unreasonable about expecting the original code to be optimized by the compiler.


Edit: By the way I am guilty of rewriting C code at the micro level in order to help GCC optimizer along. But we shouldn't have to do this in the first place.

Edited 2011-06-11 10:08 UTC

Reply Parent Score: 5