GNU GCC Vs Sun's Compiler on a SPARC
JigSaw writes "When doing research for his evaluation of Solaris 9 on his Ultra 5, Tony Bourke kept running into the same comment online over and over again: Sun's C compiler produces much faster code than GCC does. However, he couldn't find one set of benchmarks to back this up and so he did his own."
I wish this guy would tell us what CPU he's using. There's a hell of a lot of difference between the low-cache and high-cache CPUs (yes, these will work in a u5 as well as a u10). Looks like he's using a low-cache one, where there's not as much difference (and where the 64bit penalty isn't as noticeable).
To me this was the most interesting line of the article:
Sun's compiler was the clear winner. Surprisingly, the older version of GNU's GCC beat 3.3.2 by a very slim margin.
One of my favorite version numbers (2.95.3) is still getting good press. Cool.
dtg
The truth is an offense, but not a sin.------R. N. Marley
Of course a vendors supplied compiler that doesn't have to even think about potential optimizations for another platform will outperform it. It is a testiment to the gcc folks that it is even close.
I have mod points and I am not afraid to use them
See Tony Bourke's older article, which conluded that 64 bit binaries are slower than 32 bit binaries. This set of statistics he posted has totally obliterated his previous conclusion. He had only used GCC 3.3.2 and assumed that compiling for both 32 and 64 bits were optimized similarly. However, in most of the benchmarks he did with Sun's compiler, 64 bit programs came ahead of 32 bit ones. This means that GCC 3.3.2 is not as well optimized for his computer for 64 bits as for 32 bits, while the Sun compiler is. If he had just looked at his own data, he would have seen that.
...and a better performance not even all of the time, especially on a 32-bit platform, I choose GCC.
However, I'd like to see a well-thought out criticism of this piece. It seems like someone always has a good counterpoint to any given set of benchmarks.
So, the benchmarks show maybe a 10-15% difference in favor of Sun's compiler. Does that Sun's compiler a "clear winner"? I think not.
First of all, it's far from clear that those differences are real. You can get much bigger differences from just changes in caching behavior, even with the same compiler.
Then, there is the question of whether Sun's compiler is actually correct. A lot of commercial compilers intentionally skirt or break the letter of the ANSI standards once you start enabling optimizations. GNU C/C++ is usually more careful.
Finally, you have to ask whether it matters. So, Sun's overpriced machines using their overpriced compilers run a bit faster than their overpriced machines using a free compiler. So what? If you want bang for the buck, or even just maximum bang, why in the world would you buy a Sun these days anyway?
Next they'll be concluding what language is fastest by writing "Hello World!" in C (compiled in 64 & 32 bit), Logo, Perl and Prolog.
I hope to be posting a full writeup on how much faster MS-DOS is compared to BSD using boot times as a benchmark.
Conformity is the jailer of freedom and enemy of growth. -JFK
It's important to remember that Sun's compilers are optimized for Sun's big machines, so you don't really see the biggest advantages of the Sun compilers on single or even dual CPU machines. The Sun compilers really shine on the massively SMP machines such as the 10K, 12K, and 15K.
Of course I don't have any links to benchmarks that prove this, so take it or leave it. But Sun specifically does not care about compiler optimization for their "toy" machines such as the Ultra 5, Ultra 10, Blade 100, etc. Basically, if your Sparc CPU isn't a straight II or straight III, Sun's not as concerned with you.
I did not design this game/I did not name the stakes/I just happen to like apples/And I am not afraid of snakes-AniD
Using DEPRECATED compilers is just as stupid as using DEPRECATED kernels(2.4, just to name one)
Reason number 27 that I switched from Linux to FreeBSD. I got sick and tired of being treated like a lame poser just because I was still using last week's kernel.
Don't blame me, I didn't vote for either of them!
Well slice it which ever way you want, this jives with what i hear about the virtual water cooler. gcc is all well and good on x86 (as where its been tweaked for ages) but not always the best elsewhere. MacOS X is where i hear this mostly. The more aggressively it get used outside of x86 land the more it will get tweaked.
Move along nothing to see here.
...of who is using SPARC instead of x86 if they're worried about a 5% performance difference.
May we never see th