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.
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. ;-)
"gcc, icc, LLVM and Sun"
..this would be interesting indeed.
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.
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.
According to this thread on opensolaris.org you can download GCC 4.3 from here:
It was built against Build 104, but should work on build 101b (Opensolaris 2008.11)
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 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
Last edited by etacarinae; 02-20-2009 at 12:39 PM.
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.
Originally Posted by TheDidouille
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.