GNU GCC Vs Sun's Compiler on a SPARC 72
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."
What CPU? (Score:4, Informative)
Re:What CPU? (Score:3, Informative)
Re:What CPU? (Score:4, Informative)
The system I'm using is a second generation of the Ultra 5, released in late 1998. Here are the specs:
System: Sun Ultra 5
Processor: UltraSPARC IIi 333 MHz, 2MB cache
Memory: 256 MB
HD: Seagate Medalist 7200 RPM IDE Pro 9140 8.4 GB
IDE Controller: Built-in UDMA2, 33 MB/s max
CD-ROM: 32x IDE
Video Controller: Sun PGX24 (ATI Mach64), 4 MB VRAM
Network: Built-in 10/100 NIC (hme, "Happy Meal" interface)
My knowledge of sun processors is a little lacking in the UltraSPARC II range, so I'll leave it to you to evaluate this one, My only exposure is the dead server CPU module for a paperweight. It and a foxtrot on the corkborad are my own version of the geek purity test.
Re:What CPU? (Score:3, Informative)
It's the 333 MHz processor with the 2 MB cache. (The same one that's in the U10 I'm using right now, by the way).
Re:What CPU? (Score:1)
ah 2.95.3, we hardly knew ye (Score:4, Interesting)
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
Re:[TROLL]Re:ah 2.95.3, we hardly knew ye (Score:2)
How is 2.4 deprecated? 2.6 is not even in all distros yet. Even Linus says wait on 2.6.1 or 2.6.2 to get any real work done.
Re:[TROLL]Re:ah 2.95.3, we hardly knew ye (Score:2)
Re:[TROLL]Re:ah 2.95.3, we hardly knew ye (Score:3, Funny)
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.
Re:[TROLL]Re:ah 2.95.3, we hardly knew ye (Score:1, Funny)
Re:ah 2.95.3, we hardly knew ye (Score:2)
Because they have nothing to lose?
Actually, he did (Score:1, Informative)
OT,but someone has to make the [NO CARRIER] joke (Score:1, Funny)
Why does this suprise ANYONE (Score:4, Insightful)
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.
Re:Why does this suprise ANYONE (Score:4, Informative)
Re:Why does this suprise ANYONE (Score:4, Funny)
And since the excerpt was from the info pages for GCC, you and stallman are likely the only humans to have ever read it.
Re:Why does this suprise ANYONE (Score:5, Insightful)
People think that "The Cathedral and the Bazaar" was made in comparison between commercial and non-commercial programming models. It actually was modeled on FSF gcc (the Cathedral) and Linux kernel (the Bazaar) development. Eventually, at least in gcc development, the Bazaar won.
Re:Why does this suprise ANYONE (Score:2, Interesting)
Re:Why does this suprise ANYONE (Score:5, Interesting)
I was talking to some Novell engineers at Linux World. They all love watcom. The watcom toolchain is being ported to linux. It already self bootstraps. Novell owns SuSE. I expect SuSE will be making use of watcom for linux in the future. All my projects are going to use Watcom from now on. I'm sick of the annoying voo-doo neccessary to make a cross compiler between unix and mingw/cygwin/djgpp using gcc. Watcom lets me cross compile out of the box. Granted the IDE needs some work, but wmake very powerful, though unique. All the basic unix userland you expect for a makefile (cp, rm, install) is a builtin command and calls to the tool chain (compiler, linker etc) are loaded as DLLs saving system calls, thus improving performance.
GCC is very mature, popular and supported, but its not going to be the only kid on the block for long now that Watcom is open source.
Re:Why does this suprise ANYONE (Score:2, Insightful)
Re:Why does this suprise ANYONE (Score:2)
Its my understanding that thekernel is chock full of GCCisms, however userland is a different story. Main obscacle to compiling kernel on watcom will be convincing Linux to accept patches that remove the gccisms or provide watcomisms as appropiate. I do believe that this wil
Re:Why does this suprise ANYONE (Score:2, Insightful)
Perhaps that's because Netware was written in Watcom C? Netware was very impressive in its day (late eighties, early nineties) having many features that we take for granted in Linux today. Watcom's C compiler used to be the best on the market for PeeCees, and could produce flat, 32-bit code for DOS extenders back when Microsoft C was still messing about in 16 bits. If you wanted to write an NLM for Netware, you used Watcom. It also
Re:Why does this suprise ANYONE (Score:2)
Yeah netware guys said netware was built using watcom. Also, the watcom dev team all seem to use OS/2 Warp.
Re:Why does this suprise ANYONE (Score:4, Informative)
Re:Why does this suprise ANYONE (Score:1)
Actually, I first started using gcc because it was significantly faster than Sun's compiler for its M68K machines. Of course that was almost 15 years ago, but I know that's one of the reasons it became popular. I don't think this was the case for the early Sparc based machines though. Our sysadmin at the time said that in order to get decent performance out of the chips, Sun had to put more effort into the compilers than it did for the previous machines. FWIW, on Data General's M88K-based machines, gcc
Re:Why does this suprise ANYONE (Score:2)
Bad Statistics? (Score:5, Interesting)
Re:Bad Statistics? (Score:2)
Looks like to me that Sun's 64bit code won 7 out of 22 tests against Sun 32bit code.
The rest are either loses or near ties.
well, for $2995 vs. $0.00... (Score:3, Insightful)
...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.
Re:well, for $2995 vs. $0.00... (Score:4, Informative)
That said, the fact that a generic compiler like gcc is within spitting distance of Forte or SunONE or whatever they call it this week is impressive.
Re:well, for $2995 vs. $0.00... (Score:3, Informative)
gcc supports this.
Re:well, for $2995 vs. $0.00... (Score:1)
They already have this. Do -xautopar when using cc.
Re:well, for $2995 vs. $0.00... (Score:2)
Sun used to (and may still do) claim that their compiler produced better code than GCC.
Sun's FORTRAN compiler is much more complete than g77/g95 - no offense intended to either Craig Burley or Toon Moene.
"clear" winner??? (Score:5, Insightful)
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?
Re:"clear" winner??? (Score:4, Insightful)
Re:"clear" winner??? (Score:2)
The point I was most interested in is that gcc and Sun's compiler are about the same speed on 32 bit code, and Sun pulls ahead on 64 bit code.
Re:"clear" winner??? (Score:2)
Without doing any sort of conclusive tests, I've tested three of my machines with
for speed. Here's how it panned out;
Re:"clear" winner??? (Score:5, Informative)
That may explain the speed difference that you are seeing.
Re:"clear" winner??? (Score:2)
That's why I tested a Mac with a 138MHz speed deficiency which came up almost number-for-number evenly matched with its processing superior.
Is there some documentation as to the machine-specific optimizations of OpenSSL on the various architectures it supports?
Re:"clear" winner??? (Score:2)
do a lot more per cycle than do the more
deeply pipelined ultrasparcs, which in turn
do a lot more per cycle than do the absurdly
deep x86s.
Re:"clear" winner??? (Score:2)
I have a Sun Ultra 10, 333MHz UltraSPARC IIi with 2MB cache and 128MB RAM in one bank (I realise I can get better memory bandwidth while using two banks).
I can confirm, the machine runs like a two legged dog.
If it were not for the fact that I want to improve my Solaris skills (the whole reason I bought the machine), it would be running OpenBSD as my
Re:"clear" winner??? (Score:2)
Re:"clear" winner??? (Score:1)
Sun's overpriced machines using their overpriced compilers run a bit faster than their overpriced machines using a free compiler.
In my eyes I would rather spend the $2995 on buying a new PC. Hell ... if I wait 6 months before I buy it I'll easily get a 10-15% speed increase on all the programs running on the machine (+ have money to spare).
Re:"clear" winner??? (Score:1)
Re:"clear" winner??? (Score:2)
More technical brilliance from OSNews (Score:3, Insightful)
I hope to be posting a full writeup on how much faster MS-DOS is compared to BSD using boot times as a benchmark.
Re:More technical brilliance from OSNews (Score:2)
Re:More technical brilliance from OSNews (Score:2)
Sun's compilers are optimized for the big iron (Score:4, Interesting)
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.
Re:Sun's compilers are optimized for the big iron (Score:1, Interesting)
On all modern machines, the first rule of good code performance is to keep memory access to the very minimum, by utilising cache. This happens to be exactly what helps big SMP machines too. There is no tradeoff there.
A secondary but still important aspect is the theoretical execution speed you get when you disregard cache misses. The important things here are picking an efficient instruction stream, and good instruction scheduling and register allocation. This is as important on "toy
Re:Sun's compilers are optimized for the big iron (Score:2)
Re:Sun's compilers are optimized for the big iron (Score:1)
First observation: 64bit mode was twice faster than 32bit one (you sort of expect that).
Second observation: gcc with "-m64 -O3" produced co
the achille's heel? (Score:4, Interesting)
Move along nothing to see here.
-fast not that fast for most cases (Score:1)
Benchmarks and leapfrogging (Score:1)
I worked for a compiler vendor once and at a particular point in time Greenhill Oasis, a competitor, compared Drystones benchmarks values in an advertisment between ourselvs, gcc and their own compiler. They turned out to be 3 to 5 times faster
Re:Benchmarks and leapfrogging (Score:2)
Re:Benchmarks and leapfrogging (Score:1)
Your time is better spent finding better ways to solve your problems than fighting for an extra 20% performance out of compiler optimizations. When compilers tries to make tricky optimizations ugly and hard spotted compiler bug
-march instead of -mcpu (Score:1)
Re:-march instead of -mcpu (Score:2)
Of course, this puts forward the question... (Score:3, Insightful)
Re:Of course, this puts forward the question... (Score:2)
Much as I'm not really a Mac fan, if you want a RISC and Unix based workstation, just get a G5 with MacOS X. There you go. It's Unix, it's RISC, and it runs circles around Sun's workstations, at a fraction of the price.
Or yeah, x86. Get a cheap Dell, install Linux on it, and there you go. It's a Unix workstation. Sun's over-priced under-perfoming stuff won't even come near it in terms of performance.
Re:Of course, this puts forward the question... (Score:1)
Re:Of course, this puts forward the question... (Score:2)
A. Hired a competent programmer, for a change, and
B. stopped letting a clueless maketroid or PHB insist that the software must have all possible buzzwords (e.g., instead of directly write a value in the database, it now sends a SOAP message over MQ to an EJB, which finds and parses another XML message _in_ the SOAP message, and parses it to find the value and table name)
Missing information... (Score:1)
Which compiler is fastest at the act of actual compilation?
If GCC compiles mysql in 10 minutes and Sun's compiler takes 15...
Which compiler makes smaller binaries?
Re:SIMD instructions on SPARC (Score:2)
Sun could do a lot more to promote use of the VIS.