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

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