Overview

After completing the first stages of program development, like design and debugging, you can use performance tools such as Saturn to help optimize your program. Saturn helps you understand your program’s function-calling structure and how much time was spent in each function. Saturn consists of two parts: a graphical front-end and a dynamic library back-end. The Saturn back-end library leverages the instrumentation infrastructure in gcc to generate an output file that summarizes how much time your program spends in various functions. The Saturn front-end can then read this file and present a representation of the function calling patterns and a function tree view.

UNIX implementations typically support a notion of compiler driven function instrumentation by specifying compiler flags to request instrumentation. The compiler supplied by Apple responds to two different command line options:

Saturn allows you to visualize the data in two ways: a traditional call-tree view and a graphical call-stack timeline. Using this information, you can eliminate expensive calling behavior (for example, deep call stacks which do not last long) as well as understand which functions take up the greatest portion of execution time.