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

7 of 72 comments (clear)

  1. ah 2.95.3, we hardly knew ye by dingbatdr · · Score: 4, Interesting

    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
  2. Bad Statistics? by Josh+Booth · · Score: 4, Interesting

    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.

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

    GCC is an excellent compiler. I was surprised why it didn't beat SUN's CC. In my experience, gcc frequently generates code which is at least as good or slightly better than vendor's compiler (at least for DEC, SPARC and Intel platforms). There are special cases, say OpenMP, SSE2, ect, when vendor's compiler does a better job (and gcc currently doesn't support openmp), but in most cases I can easily believe that gcc will be the best. In addition, knowing that a certain version of gcc compiled 8000 Debian packages for 10 different platforms and didn't failed (or if failed, a bug was submitted) is a good indicator that you can trust this compiler. Add to this that compiler gets better with each release and I think it will soon be what Linux is for UNIX - making the rest obsolete.

  4. Sun's compilers are optimized for the big iron by lindsayt · · Score: 3, Interesting

    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
    1. Re:Sun's compilers are optimized for the big iron by Anonymous Coward · · Score: 1, Interesting

      This is utter rubbish.

      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" machines as it is on big SMP...

      "Of course" you don't have links, so why am I replying to a troll?

  5. the achille's heel? by MrLint · · Score: 3, Interesting

    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.

  6. Re:Why does this suprise ANYONE by j-pimp · · Score: 4, Interesting

    Add to this that compiler gets better with each release and I think it will soon be what Linux is for UNIX - making the rest obsolete.

    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.

    --
    --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.