Slashdot Mirror


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."

9 of 72 comments (clear)

  1. Why does this suprise ANYONE by MerlynEmrys67 · · Score: 3, Insightful
    I mean gcc's strength has never been fast code (all though it is no slouch) it has been cross platform. You can use GCC on everything from the biggest 64 bit procs down to the smallest embedded CPUs.

    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
    1. Re:Why does this suprise ANYONE by cant_get_a_good_nick · · Score: 4, Insightful

      Those may have been Stallman's original goals, but not necessarily of gcc anymore. Remember that the maintainers of gcc now aren't the original Stallman lead, FSF gcc folks, but of the splinter egcs group that forked gcc because they were extremely frustrated with the progress of gcc under the FSF. Once it became evident that egcs was making progress leaps and bounds past the FSF gcc, (to Stallman's credit) work on FSF gcc was dropped, and the egcs gcc became the official gcc.

      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.

    2. Re:Why does this suprise ANYONE by Vladimir · · Score: 2, Insightful

      All I can say - competition is good. If Watcom is a decent compiler and will be able to compile kernel and Linux distro I am very glad. Most likely gcc team look critically what is good and what is bad and improve things were needed.

    3. Re:Why does this suprise ANYONE by turgid · · Score: 2, Insightful
      I was talking to some Novell engineers at Linux World. They all love watcom.

      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 targetted OS/2. Those were the days.

  2. well, for $2995 vs. $0.00... by amarodeeps · · Score: 2, 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.

  3. "clear" winner??? by ajagci · · Score: 5, Insightful

    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?

    1. Re:"clear" winner??? by SewersOfRivendell · · Score: 3, Insightful

      Assuming he measured correctly, 15% is a lot. It's the minimum threshold for user-perceivable speed improvement, among other things. A lot of people would kill to have 15% faster compilers, kernels, databases, window managers, etc.

  4. More technical brilliance from OSNews by duffbeer703 · · Score: 2, Insightful

    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
  5. Of course, this puts forward the question... by 0x0d0a · · Score: 2, Insightful

    ...of who is using SPARC instead of x86 if they're worried about a 5% performance difference.