Benchmarking Intel C++ 6.0 to GNU g++ 3.0.4 59
axehind writes: "Here is a good article detailing a benchmark [comparison] between the two compilers. The results are very interesting."
Kleeneness is next to Godelness.
Hey, it being available is just -cool- to me. (Score:3, Interesting)
I still use gcc just because everything I have (theKompany's KSG, for instance) is presetup for gcc.
Maybe I'll play with the Intel compiler though I do nothing that "intensive." Most of my stuff waits on the user.
.:|T
Did Intel fix the "-ipo"-bug in 6.0? (Score:2, Interesting)
Kudos to GCC (Score:5, Interesting)
Aside:
Personally, for initial developemnt of cross platform stuff, I actually use Borland's C++ Builder compiler and linker. It produces slow code, but it's amazingly fast at compiling and linking. The debug and compile cycle goes so much faster - that I get more work done faster than with Emacs and GCC. After the code runs well on Windows - I move on to testing with GCC on other platforms.
Speed isn't everything but... (Score:3, Interesting)
Icc also:
* Supports OpenMP.
* Has a great debugger for multithreaded code.
* Has handy profiling and optimisation tools.
* Is highly standards compliant.
Granted, gcc wins hands down on portability though.
Inlining slows performance? (Score:2, Interesting)
Question? (Score:3, Interesting)
Intel's compiler beat gcc badly on the Monte Carlo and Mazebench(w/o image saves). Both these two apps use rand() and there are multitudes of different algorithms for random numbers.
Perhaps the Intel compiler is using it's own algorithm for rand() that cuts corners?
Re:Please - ICC and a meritocracy. (Score:3, Interesting)
I believe in 'may the best man win,' Intel's compiler is certainly worth buying, and if your production code needs the speed boost the be more competitive, then there is no choice - it must be done the best way.
This isn't about licensing, who makes, if its open or not, its about a meritocracy voting on what's the best way to see performance on a given platform.
I would love for Gentoo to allow the use of ICC to compile the whole distribution. It not possible for certain things, but I'd like to see it done.
Re:Please (Score:4, Interesting)
Why use -fast-math? (Score:5, Interesting)
While there are some uses for it, I doubt that any serious floating-point codes would use "fast-math" (shorthand for "not-quite-right-math"). IEEE math is not perfect, but it allows one to estimate and control error accumulation reliably. The correct response to discovering that ICC defaults to fast-math is not to enable it in GCC, but disable it in ICC.
I've no idea whether it change the relative result of the benchmarks, but at least they'd be representative of actual use. (Or run them both ways, actually, to see which compiler is "cheating" more :-)).
Re:Please (Score:2, Interesting)
But just try benchmarking gcc to SUN Workshop compiler on Sparc, or the Compaq C Compiler on Alpha, or even MipsPRO on Mips, the difference between gcc and these compilers is MUCH bigger than icc`s.
If code were written cleanly (ie not using ANY nonstandard extensions present in compilers, including gcc) then this wouldnt be an issue, people would just be able to go ahead and compile using the compiler of their choice. Many programs do infact compile without gcc, and result in huge performance gains.
gcc is to C compilers what msie is to browsers - commonly used, and easier to code for - while making your code incompatible with others, and yet inferior in MANY ways.
Inlining problems (Score:3, Interesting)
The second conclusion is that gcc is better at massive inlining. The coding style I used on this project was to make heavy use of inline functions instead of macros. Often, to get decent code to be generated would require a few dozen functions to be inlined into each other, and the results to be attacked by -O3. Afterward, these things would produce small, fairly tight code sequences of only a dozen or so instructions.
When I switched to icc, I noticed an immediate tenfold decrease in performance. The culprit: lack of inlining. icc has a number of strict requirements for functions that are to be inlined, and most of my functions broke at least one of these rules. (For instance, ironically enough, it can't inline functions that contain asm directives.) For some of them, I couldn't tell what rule was being broken; I could only see that the function wasn't inlined. Furthermore, icc essentially ignores the "inline" directive, so there was nothing I could do about it. By contrast, gcc obeys "inline" unless that is totally impossible.
Granted, the optimizations that gcc does after inlining are less than ideal, but people are working on that, and I gather that the 3.x releases are supposed to be much better than the 2.x. Anyway, that was a price I was willing to pay in order to use inline functions instead of macros.