Mac OS X Reference Library Apple Developer
Search

Introduction

Performance is the measure of how efficiently your software uses resources such as the CPU, memory, and hard drive. Improving performance involves establishing a set of target goals and then measuring the efficiency of your software against those goals. Apple provides tools for measuring your software efficiency in several different ways. Using your measurements, you can then decide an appropriate course of action for modifying your code and meeting your goals.

There are many ways to improve software performance, but not all of them are appropriate for every situation. Diagnosing performance problems requires some detective work on your part, but Apple’s performance tools can help you in this endeavor. With these tools, you can gather information such as the following:

From this and other information, you can identify reasons why your application does not match your performance goals and proceed with fixing those problems.

Start Here

To determine where your application might have performance issues, you should gather a set of baseline metrics first using the Instruments or Shark applications. Metrics help you identify potential problem spots in your code. You can also compare your set of baseline values against later measurements to verify that the changes you made had the desired effect.

Tuning your code is an iterative process. You gather metrics, you make changes, and you repeat the process until you achieve the desired level of efficiency. And there is no single metric that can tell you the “performance” of your application. What you are really looking for is data that shows how efficiently your code performs its tasks and how responsive your application is to the user. When it comes to efficiency, there are several factors you need to consider:

Want to get familiar with the fundamentals?

Prefer to learn by example?

Go in Depth

If you’re just starting a new programming project, your designs should take performance into account. If you’re improving the performance of an existing program, you want to find the bottlenecks in your code. If you’re looking for peak performance, you want to tune it for specific hardware.

Designing for Performance

Before you can build performance into your code, you need to understand what is meant by performance. There are many ways to measure performance, but not all of them may be relevant to your application. Knowing which performance metrics are important to you can heavily influence design decisions.

The document Performance Overview contains information related to designing your application with performance in mind.

Improving Your Existing Code

Diagnosing performance problems requires real data and not guesses. Apple’s performance tools provide metrics that you can use to identify potential problems. For some specific problems, there are also ways to take advantage of multithreading and Velocity Engine to improve performance.

Tuning Code for Specific Hardware

Hardware optimization is one of the last steps for developers who need to maximize the performance of their applications. To optimize for specific hardware, you’ll learn how to use the CHUD tools and optimize for the target processor.

Ready for More?

The Snow Leopard Reference Library holds plenty more resources that make your job easier. To narrow the list of resources, you can set filters to focus on specific resource types (such as guides or sample code) or on specific topics (such as graphics and imaging or multiprocessing).



Last updated: 2009-05-27

Did this document help you? Yes It's good, but... Not helpful...