Sun Java Solaris Communities My SDN Account Join SDN
 
Sun Studio

Sun Studio: Performance Tuning and Optimization

An application's performance depends on a combination of hardware and software factors. Sun Studio C, C++, and Fortran compilers offer a rich set of compile-time options for specifying target hardware and advanced optimization techniques. But knowing which options to pick for a given application can be tricky. You can learn about various performance analysis and optimization techniques and tools from many articles and books on the subject. This topic page highlights a number of them.


Technical Articles on Performance Optimization

  • Calculating Processor Utilisation From the UltraSPARC T1 and UltraSPARC T2 Performance Counters
    Use the performance counters for the UltraSPARC T1 and UltraSPARC T2 processors to estimate core load and find potential areas for performance improvement.
  • Prefetching Pragmas and Intrinsics
    Explicit data prefetching pragmas and intrinsics for the x86 platform and additional pragmas and intrinscs for the SPARC platform are now available in Sun Studio 12 compilers. Prefetch instructions can increase the speed of an application substantially by bringing data into cache so that it is available when the processor needs it. This benefits performance because today's processors are so fast that it is difficult to bring data into them quickly enough to keep them busy, even with hardware prefetching and multiple levels of data cache.
  • Performance Tuning With Sun Studio Compilers and Inline Assembly Language
    Here are examples of using a compiler flag or inline assembly language with Sun Studio compilers to increase the performance of C, C++, and Fortran programs.
  • Using F95 Interfaces to Customize Access to the Sun Performance Library
    When porting Fortran source, the Fortran 95 generic interface can be used to allow the source code to remain virtually unchanged and yet facilitate the use of the ILP-32, LP-64, and ILP-64 programming models.
  • A case study in program optimization.
  • Getting the Best AMD64 Performance With Sun Studio Compilers
    Performance is a factor of both hardware and software. To extract the maximum performance from the new AMD-64 based systems on your critical C/C++ and Fortran applications, choose the best compilers. Then use compiler options to take advantage of the Opteron system features to maximize performance. This article will show you how.
  • Using VIS Instructions to Speed Up Key Routines
    The VIS instruction set includes a number of instructions that can be used to handle several items of data at the same time. These are called SIMD (Single Instruction Multiple Data) instructions. The VIS instructions work on data held in floating point registers. The advantage of using VIS instructions is that an operation can be applied to different items of data in parallel; meaning that it takes the same time to compute eight 1 byte results as it does to calculate one 8-byte results. In theory this means that code that uses VIS instructions can be many times faster than code without them.
  • The Sun Studio Binary Optimizer
    The Binary Optimizer is a static SPARC optimizer that accepts as input a binary and creates an optimized binary as the output. We define a binary as either an executable or a shared object. The availability of the original source code is not a pre-requisite for using this tool. It can optimize binaries irrespective of the source language used (C, C++ or FORTRAN). It can also optimize mixed source language binaries.
  • Advanced Compiler Options for Performance
    Users wanting the best performance from CPU-intensive codes may wish to explore the use of additional libraries and advanced compiler options that control individual compiler components.
  • Selecting the Best Compiler Options
    How to get the best performance from an UltraSPARC or x86/AMD64 (x64) processor running on the latest Solaris systems by compiling with the best set of compiler options and the latest compilers? Here are suggestions of things you should try, but before you release the final version of your program, you should understand exactly what you have asked the compiler to do.
  • Using Inline Templates to Improve Application Performance
    Inline templates are a mechanism for directly inserting assembly code into an executable. Typically, this approach is used to obtain the best performance for a given function, or to implement an algorithm in a specific way.

Additional Resources on Optimization

HPC Developer Resources
The Sun HPC Community Portal lists a number of resources for developing high performance applications.

Techniques for Optimizing Applications: High Performance Computing by Rajat P. Garg and Ilya Sharapov
This Sun Blueprints Series book is a practical guide to performance optimization of computationally intensive programs on Sun UltraSPARC[tm] platforms. It is primarily intended for developers of technical or high performance computing (HPC) applications for the Solaris operating environment.

Videos - Here are two presentations by Ruud van der Pas of the Scalable Systems Group at Sun Microsystems. These were given at RWTH Aachen University, Germany, in March 2006 as part of the Sun HPC Workshop.

Weblogs
Sun Studio engineers often discuss optimization techniques and tips on their weblogs. You can also send them comments for further information.

 
Related Links