Paul Hinker's Weblog
Saturday Oct 29, 2005
The Sun Studio compiler collection and Linux
Sun has rolled out an early access version of the Sun Studio Compiler collection for Linux. Since the defacto standard for a Linux compiler is the GCC offerings, I thought I would run some quick comparisons to see how the beta version of the Studio C compiler stacks up against GCC 3.4.3 on Solaris and Linux. I didn't choose these benchmarks, I was asked about them by another Sun Engineer. I spent less than 5 minutes fiddling with compiler flags for the Studio compiler (using just -fast -xarch=amd64 whenever possible). The three benchmarks I looked at where SciMark2, uBench-0.32, and UnixBench-4.1.0. As I've blogged before, I'm not a fan of these 'do nothing' benchmarks.
The SciMark2 set of benchmarks provided by the folks at NIST. It's apparently a Java benchmark but there are C code versions of the tests which can be compiled and run natively. The Solaris/Sun Studio combination is the winner here by a small margin. The Linux/Sun Studio C compiler makes a good showing even though some of the runtime and include libraries aren't available yet (libmvec and libm.il).
The UnixBench application is also made up of a series of microbenchmarks which aim to test a variety of compiler and OS features. Here the beta Sun Studio C Compiler gives GCC a sound drubbing (~20% by composite score). I really know almost nothing about this benchmark but just by glancing through the output it appears to me that there's some scaling difference between the Linux and Solaris results so I didn't feel it an apt comparison to put all four variations on the same graph. Again, in both cases (Solaris and Linux), the Studio compiler produces the better results.
uBench (which for all I know is the pre-cursor to UnixBench) claims to spawn 'about 2 concurrent processes for each CPU available on the system'. I'm a little unsure as to how one goes about spawning 'about' two processes but I'll take the author (one Sergei Viznyuk according to the readme) at his word. The readme also states that the benchmark does floating-point and integer calculations at 'about' a 1:3 ratio. It also performs some 'rather senseless memory allocation and memory to memory copying operations'. The reader might now be starting to understand why I have such a low opinion of benchmarks of this ilk.
Going to the author's webpage I see that he says, "Please make sure you compile ubench using only -O2 or -O optimization flags. More aggressive optimizations tend to alter the semantics of the code and skew the results." Well, there you have it.
Posted at 12:32AM Oct 29, 2005 by hinkthink in General |

