Performance Starting Point for OS X

When writing software for OS X, optimizing code to minimize use of the processors and memory is crucial to the performance of your application and therefore to a good user experience.

Figure 1-1Use the Instruments application to analyze and optimize your code image: Art/Templates.jpg

Contents:

Get Up and Running

Performance Overview helps you get familiar with the fundamentals of performance analysis.

The main tool for analyzing your code’s use of the CPU, GPU, and memory is the Instruments application. Each of the tools in Instruments is documented in Instruments User Guide.

Become Proficient

There are several aspects to performance, including memory use, speed, and drawing performance.

To learn how to reduce your application’s memory footprint, read Code Size Performance Guidelines.

To find and improve bottlenecks in your code that affect its speed, see Code Speed Performance Guidelines.

To make your drawing code more efficient, see Drawing Performance Guidelines.

For details on management of memory resources, see Memory Usage Performance Guidelines.

If you are writing a Cocoa application, read Cocoa Performance Guidelines for tips on how to use the Cocoa frameworks more efficiently.

To learn how to improve the efficiency of your algorithms so your application doesn’t slow down with large data sets, read Code Speed Performance Guidelines.

If your application performs complex math or image calculations, read Taking Advantage of the Accelerate Framework to learn how to use the Accelerate framework to speed up operations using the available vector hardware.

Good Document Transfer Strategies Can Speed Up Networking

To improve the performance of your networking code, read TN2152: Document Transfer Strategies.

Sample Code

The Worm sample project illustrates several optimizations for NSView.

The OpenCL Hello World Example shows how to use OpenCL to leverage the GPU for general computations.

Performance Tips

Here are some tips to maximize performance: