Fog Creek Software
g
Discussion Board




Intel, GNU and compiler benchmarking

In the film Revolution OS ( http://uk.imdb.com/title/tt0308808/ - good film btw)) one of the people being interviewed states that after he ported the GNU C compiler to a novel (not the company!) platform, it  performed that much better than the compiler released by the people who made the platform. I can't remember who it was or what the platform is.

I remember reading somewhere, probably in the form of an off-the-cuff remark so say, that Linux kernels compiled with the Intel compiler ran faster due to additional optimisations than those compiled with the GNU C Compiler. I can't find the post now, but not a lot of detail was given (Disclaimer: This was not made as a statement of fact backed up by benchmarks, may only be true under certain conditions, or indeed may not be true at all).

I've looked around for benchmarks comparing the GNU and Intel compilers but all I can find that looks decent is http://www.coyotegulch.com/reviews/intel_comp/intel_gcc_bench2.html .

I was wondering if anyone had something a little more comprehensive, preferably including other compilers (MSVC and/or Watcom) and if so would they please be kind enough to point me in the direction of it.

Thank you.

Anon
Monday, March 8, 2004

Speed, fair enough. Maybe the intel compiler does it faster, great.

Personally i'll take cross platform over speed. gcc is by no means perfect, in fact groups like OpenBSD want to get rid of it, but there isn't anything out there which  is under a BSD license that can do the same.

fw
Monday, March 8, 2004

The Intel compilers has some optimizations, the Visual C++ is pretty competitive. I don't think the GNU compiler generates code running an order slower though, considering how many x86 people uses it, it's pretty optimized given the situation.

Li-fan Chen
Monday, March 8, 2004

Li-fan Chen, I think that it actually is about an order of magnitude slower at least, from the slides I saw.  Stroustrup gave a talk here at my work a few weeks ago, and had some slides comparing code compiled with the GNU compiler, equivalant FORTRAN, and the SGI or intel compiler (can't remember which, and couldn't find the slides online just now).

In fact, Stroustrup also made an off-the-cuff remark about GNU's lack of optimization, paraphrased along the lines of "Some people [SGI|Intel?] are really good at compilers, and some people (implying GNU) like to think they are good but they really are not".

The slides showed the fast C++ compilers being faster than FORTRAN, and about 8 times faster than the GNU compiler.

Andrew Hurst
Monday, March 8, 2004

GNU is probably not optimized to take full advantage of the latest instruction set for the Pentium III/IVs the way that Intel's and possible VC++'s compilers would be.  In other words, if you're doing something that's heavy on floating point math, vector and matrix operations, you will probably get a lot of benefit from a professional compiler.

However, if you restrict to code to the basic Intel instruction set without the fancy instructions, you'll probably get excellent results across the board.  It shouldn't matter except for multimedia.

Your mileage will also vary depending on whether you're using an Intel or AMD chip.


Monday, March 8, 2004

We tested Intel's C++ compiler vs GCC on our x86 software (image processing). The Intel binary ran about 10% faster. We didn't play around with all of the fancy optimization options though.

One GREAT advantage of IC++ on Linux is that it is (mostly, I think) link-compatible with GCC-generated code. So you don't have to use it for everything, and you don't have to use their runtime library. You can compile some stuff with GCC and some stuff with IC++, and it will link.

Dan Maas
Monday, March 8, 2004

We tested Intel's C++ compiler vs MSVC++ on some of our x86 software (image processing: integer and bit arithmetic, not floating point). The Intel binary ran about 10% faster.

Christopher Wells
Monday, March 8, 2004

In the fev issue of C/C++ Users Journal there is an article by Moshe Bar comparing speed of the Linux kernel compiled with GCC and the Intel compiler for some tasks.

The result is that the Intel compiler is about 5% faster.

whatever
Tuesday, March 9, 2004

I had a dream last night comparing Intel compiler with GCC, and the dream came out 10% faster...

:-}

T.J.
Tuesday, March 9, 2004

Of course it's worth remembering that the Intel compiler primarily optimizes for Intel processors -- it may reorganize instructions to work perfectly in the P4 pipeline, but this might be detrimental on an Athlon, for instance.

Dennis Forbes
Tuesday, March 9, 2004

*  Recent Topics

*  Fog Creek Home