Linked by Tony Bourke on Mon 23rd Feb 2004 21:54 UTC
Benchmarks In continuing with my articles exploring the my SPARC-based Sun Ultra 5, I'm going to cover the topic of compiler optimizations on the SPARC platform. While many are familiar with GCC compiler optimizations for the x86 platform, there are naturally differences for GCC on SPARC, and some platform-specific issues to keep in mind.
Permalink for comment
To read all comments associated with this story, please click here.
Register windows, etc...
by MJ on Tue 24th Feb 2004 06:12 UTC

Sparcs use a sliding register structure and if you get too deep in subroutine calls it will kill performance.

These are called register windows. The performance degredation occurs from taking a Spill Trap, which is when you fill your set of register windows and have to save one off elsewhere. Judicious register use can sometimes avoid this, but then again, on x86, the standard procedure is to push everything onto the stack since register usage is tight, and there aren't really any commonly used alternate constructs.

If you really want to get the most from your UltraSPARC you should really check out gentoo linux.

I don't know if this is necessarily true or not. I'm sure gentoo works well on SPARC, but one of the advantages of having such hardware is that it's really easy to get Solaris to run on it w/o much hassle. I'd try both as they each have different features, strengths, etc. But realistically, this article is about optimizing application performance on SPARC with GCC. Tony has done a great job of presenting the topic cogently, and frankly it's not much use to have the conversation degenerate into a "my operating system is bigger than yours" contest. I'd be curious to know if he's planning a similar article for optimizations with Sun's compilers.