Announcement

Collapse
No announcement yet.

Sun Studio 12 vs. GCC3 vs. GCC4 Benchmarks

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sun Studio 12 vs. GCC3 vs. GCC4 Benchmarks

    Phoronix: Sun Studio 12 vs. GCC3 vs. GCC4 Benchmarks

    Earlier this month we published an article looking at the Linux versus OpenSolaris performance when using the new AMD Shanghai Opteron CPUs. Ubuntu Linux was faster than OpenSolaris 2008.11 in nearly all of the tests, but as mentioned in that article, OpenSolaris is still dependent upon GCC 3.4 where as Ubuntu and most other Linux distributions are now shipping with the newer and much-improved GCC 4 series. Following that article being published, Sun Microsystems had requested some compiler tests since they were confident the results would be different had their Sun Studio compiler been used. Well, in this article we now have some OpenSolaris benchmarks from the same AMD setup using GCC 3.4, GCC 4.0, and Sun Studio 12.

    http://www.phoronix.com/vr.php?view=13510

  • #2
    Not fair test, 4.0 gcc was not tuned in any way and is result of big merge of some new technologies (SSA) into mainline, AFAIK. It happened some *years* ago. Current version is 4.3.3 (!). Don't know anything about Sun's compiler, but I think Intel's icc is much more considered to be performance-king on Linux (at least thats what MySQL people said), so I would go with that compiler (or even better all 4: gcc, icc, LLVM and Sun). Anyway, criticizing is easier then doing something so I will stop here. ;-)

    Comment


    • #3
      "gcc, icc, LLVM and Sun"
      ..this would be interesting indeed.

      http://www.intel.com/cd/software/pro...eng/219771.htm

      Comment


      • #4
        On the graphicsmagick.org frontpage it says it uses OpenMP, which was added in GCC 4.2. How does GCC >=4.2 compare with Sun Studio? Otherwise you are giving Sun the advantage.

        Comment


        • #5
          Yeah, if you have a no-openmp versus openmp on a quadcore, that's not really fair.

          Also the "timed compilation" isn't very interesting, or at least shouldn't be buried with the others.

          Comment


          • #6
            According to this thread on opensolaris.org you can download GCC 4.3 from here:
            http://snvoss.googlecode.com/svn/trunk/PKGS/

            It was built against Build 104, but should work on build 101b (Opensolaris 2008.11)

            Comment


            • #7
              What were the flags used for Sun Studio btw? Those mp3 and ogg encoding results looks almost like SSE(2/3) wasn't enabled, or that Suns compiler didn't understand the SSE intrinsics used in the code.

              (.. or there's just a bug in Sun Studio here)

              Comment


              • #8
                I don't know what options you used (judging by compilation time, it seems likely you haven't used any) to compile the code with Sun Studio (and you do have to, because ./configure script will not pick up any optimization flags for it), but in my own benchmarks, lame built with Sun Studio 12 was 15% faster than lame compiled with gcc 3.4.3. Have you used "-xopenmp" to compile GraphicsMagick ?

                Originally posted by phoronix View Post
                Phoronix: Sun Studio 12 vs. GCC3 vs. GCC4 Benchmarks

                Earlier this month we published an article looking at the Linux versus OpenSolaris performance when using the new AMD Shanghai Opteron CPUs. Ubuntu Linux was faster than OpenSolaris 2008.11 in nearly all of the tests, but as mentioned in that article, OpenSolaris is still dependent upon GCC 3.4 where as Ubuntu and most other Linux distributions are now shipping with the newer and much-improved GCC 4 series. Following that article being published, Sun Microsystems had requested some compiler tests since they were confident the results would be different had their Sun Studio compiler been used. Well, in this article we now have some OpenSolaris benchmarks from the same AMD setup using GCC 3.4, GCC 4.0, and Sun Studio 12.

                http://www.phoronix.com/vr.php?view=13510
                Last edited by etacarinae; 02-20-2009, 12:39 PM.

                Comment


                • #9
                  Compiler options

                  are you sure the compiler options used for gcc and ss are equivalent?

                  Comment


                  • #10
                    Originally posted by TheDidouille View Post
                    are you sure the compiler options used for gcc and ss are equivalent?
                    They won't be. Sun compilers have a range of switches that don't directly map onto GCC and vice versa. Also the Sun compiler default has always been to use no optimisation unless specified.

                    I find it odd that the site would even bother to publish a set of "compiler" benchmarks without publishing the actual compiler flags used. It can take quite a few passes to work out what the "right" compiler options are to get the best performance out of a code - just look at the full disclosure details on the SPEC website and you'll see. For example for the SPEC bzip2 component the Sun compiles use: -fast -prefetch -auto-ilp32 and they use the Sun profiling tools with -prof-gen on the first run and -prof-use on the second.

                    Actually SPEC has helped here a little with compiler flags. The base results in SPEC benchmarks had a limit on the number of compiler flags you could use so some suppliers, Sun included, bunched together a set of optimisation flags, in Sun's case into a "-fast" option. The -fast expands to a few distinct options that select the basic optimisations appropriate to the chip in use.

                    Comment


                    • #11
                      how to Improve performance with Sun Studio 12

                      Note: With Sun Studio 12, use the '-fast -xarch=sse3a -xopenmp=parallel' flag optimizations!

                      1. The OS 2008.11 Ogg library is not optimized for the FPU or features
                      of anything above the normal i386. You need to set the optimization flags
                      for SSE2/FPU features of Pentium4/AMD64 or higher.

                      2. The Lame MP3 and GnuPg library dependencies was not optimized (see ogg library info) properly using Sun Studio 12.

                      3. Blastwave.org provides the latest GCC 4.3.2 binaries for Solaris/OpenSolaris at:
                      http://blastwave.network.com/testing...386-CSW.pkg.gz

                      Use Sun Studio 12 optimizations when using the Phoronix Test Suite. This will provide you with more realistic results on OpenSolaris performance!

                      Comment


                      • #12
                        Nice article!

                        Hopefully the gcc people will see it and improve on the less good aspects.

                        However, why produced graphs based on steps of 9, and 29? I find them much harder to read, even if the message is there and otherwise clear.

                        How do you produce the histograms? Surely there must be a way of having them in steps of 1,2,5,10,20,25,50,100, etc.

                        Otherwise, please more of this! Great stuff!

                        Comment


                        • #13
                          Now to get a benchmark of latest GCC vs latest Intel C++ on an Intel CPU

                          Comment


                          • #14
                            Fair

                            How is this a fair test?

                            SS12 was released in October 2008 (according to the article)
                            GCC 4.0.2 was released September 2005 (gcc.gnu.org)
                            GCC 3.4.3 was released November 2004 (gcc.gnu.org)

                            A lot has happened in the GCC 4.x branch. If you want to do a fair comparison, compare with GCC 4.3.2, released August 2008 and not some unsupported and obsolete version from ancient times.

                            (and no, I did not want to register and remember yet another account on some random website. Please support OpenID instead.)

                            Comment


                            • #15
                              Originally posted by npcomplete View Post
                              What were the flags used for Sun Studio btw? Those mp3 and ogg encoding results looks almost like SSE(2/3) wasn't enabled, or that Suns compiler didn't understand the SSE intrinsics used in the code.

                              (.. or there's just a bug in Sun Studio here)
                              I was thinking the same thing. It looks like LAME needs nasm to assemble it's asm sources. (libmp3lame/i386/*.nas). I don't know why gcc is fast, though. Maybe the nasm objects won't link with Sun-studio .o files? Maybe because of a -xarch=native/-xarch=native64 mixup?

                              Some projects have their asm optimizations in GNU-extension asm() statements, which they'd have to disable to build with Sun's compiler. Or anything else that needs GNU C is not going to work with Sun's compiler.

                              I tried to find the benchmark results on http://global.phoronix-test-suite.com/?k=search_results by searching for "solaris" in the operating system field. I did find a 40 second LAME result labeled SunStudio_OpenSolaris: http://global.phoronix-test-suite.co...186-4598-27835

                              and this is probably from the first story: http://global.phoronix-test-suite.co...84-28573-17746

                              So if you do it right, you can get asm optimizations with Sun's Studio compiler on LAME. (Although that result says compiler: gcc 3.4.3, so maybe it was just a trial run trying to get the parameters right.) I didn't find anything really useful googling for "mp3 lame sun studio". Hmm, I did find something with "nasm lame sun studio": LAME 3.98.2 has a commit: "Disable MMX when using Sun Studio." Maybe that's because Studio optimizes the C to better MMX/SSE itself (probably only with -xvector=simd, unless that's on by default these days), or because something is broken. It's just a few lines added to the Makefile.

                              Unfortunately, the global.p-t-s.com results don't show compiler flags used or anything.

                              As others are saying: what compiler flags were used!! I have no idea what the results mean without seeing them. I don't even know which of the tests used multiple cores. That kind of matters, because if you have an 8 core machine, you usually plan on keeping at least some of the cores busy most of the time. So you can't just compile every program to bust out multiple threads, because what if you want to run multiple things at the same time?

                              I'm coming at this from an HPC cluster background, where we tended to have embarrasingly parallel workloads, so we'd use the same single-threaded program running on a hundred different input files. With grid engine, or just make -j 8 style parallelism. I guess a desktop would be different, and someone might conceivably buy a dual quad-core just so threaded apps could run fast, and not tend to have any number crunching jobs using up any CPUs most of the time.


                              BTW, flags you should use with Sun CC (unless these are outdated now): cc -fast -xarch=native64 -xvector=simd -xipo
                              -xarch=native64 Make a binary that doesn't waste time being compatible with anything but your machine (in 64bit mode).
                              -xipo : cross-file optimization by putting source analysis into .o files, so the optimizer can run at link time.
                              read the docs. You can use -xjobs=8 to let cc fork off worker jobs when it has a lot of work to do, e.g. at link time with -xipo, if I recall correctly.

                              Comment

                              Working...
                              X