Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC

Performance & Debugging Tools Overview

The performance of Mac OS X applications can be measured, evaluated, and optimized using Apple's developer tools, technologies, and programming interfaces. Developers can fine-tune their applications for high performance using tools such as the Sampler code-profiling application, features such as multiprocessing, and APIs such as those for the vDSP library.

Apple's Xcode Tools consist of more than just a world-class IDE, object-oriented interface development tools, and application packaging software. It also comes with a complete set of powerful performance tools that can gather a wide variety of useful performance metrics for your application.

While all of these tools are useful for maximizing your application's performance, getting started with a few essential tools will help you eliminate common performance bottlenecks:

  • Shark and Sampler will tell you where your application is spending its time, and help you make your code more efficient.
  • QuartzDebug and OpenGL Profiler will help you identify your application's slow or inefficient drawing.
  • MallocDebug will help you track and optimize your application's memory use.

Standard Performance and Debugging Tools

The following tools are installed in /Developer/Applications/ as part of the standard Developer Tools package. Note that a variety of other helpful open-source tools are also installed in locations such as /usr/bin/.

  • MallocDebug tracks and analyzes memory allocated in an application. You can use this tool to find memory leaks or analyze memory allocation patterns.
  • ObjectAlloc tracks Objective-C and Core Foundation object allocations and deallocations in real-time. The tool also lets you view the retention history for an object, which can be useful in recovering memory held by over-retained objects.
  • OpenGL Profiler creates a runtime profile of your OpenGL-based application. You can view function statistics and the call-trace history of your application's OpenGL calls.
  • PEFViewer displays the contents of a PEF binary file. You can use it in much the same way you would use the nm and otool command-line tools for Mach-O binaries.
  • QuartzDebug shows screen updates in real-time by briefly flashing the areas being redrawn. You can use this tool to analyze your application's drawing behavior.
  • Sampler analyzes your application's behavior at runtime. It can identify where your program spends its time and summarize how often allocation routines, system calls, or arbitrary functions were called.
  • Thread Viewer graphically displays activity across a range of threads. It provides color-coded time-line views of thread activity and can display backtraces of activity at specific points in time.
  • gdb is the standard open-source debugger on Mac OS X, accessible from the command line (installed into /usr/bin). It integrates with Xcode to create a seamless debugging experience in the Apple IDE.

Computer Hardware Understanding Development Tools (CHUD Tools)

The CHUD Tools are applications and tools for measuring and optimizing software performance on Mac OS X as well as for hardware bringup and system benchmarking.

The CHUD Tools are delivered as a part of the Xcode Tools for Panther. Note that the command-line tools acid, amber, simg4, and simg5 are installed in the /usr/bin/ directory. For the very latest version, and for Project Builder/Jaguar developers, the CHUD Tools can be downloaded from the ftp site.

  • CacheBasher measures cache performance under a wide range of conditions.
  • MONster provides direct access to performance counters and presents the data in both spreadsheet and chart form.
  • Reggie SE lets you examine and modify CPU and PCI configuration registers.
  • Saturn instruments your code to provide function-level profiling and displays the resulting data graphically. You can use this tool to count events, such as how many times a function is called or an event occurs.
  • Shark shows you where time is being spent (both user and supervisor code), and correlates performance events to your program's code. It also supplies tuning advice about how to improve the performance of your code on G4 and G5 processors.
  • Skidmarks GT measures integer, floating-point, and vector performance.
  • acid is a command-line tool that analyzes TT6E instruction traces and presents detailed analyses and histograms. You can use this tool to detect bad instruction sequences, such as misaligned operands, data dependency stalls, and spilled loads.
  • amber is a command-line tool that traces all threads of execution in a process, recording every instruction and data access to a trace file. This tool can generate traces in TT6, TT6E, or FULL format.
  • simg4 is a command-line tool that is a cycle-accurate simulator of the Motorola 7400 processor. This tool takes TT6 traces as input.
  • simg5 is a command-line tool that is a cycle-accurate simulator of the IBM 970 (G5) processor. This tool takes TT6E traces as input.

Updated: 2005-03-17