Chapter 16. Performance Analysis

Whether it's a rollercoaster ride or a visit to the dentist, a lot of times you just want things to go faster—and the applications you build with Xcode are no exception. Speeding up an application entails finding and eliminating inefficient code, making better use of the computer's resources, or just thinking differently. Neither Xcode nor I can help you with the last one. Sometimes the most dramatic improvements in a program are those that come from completely rethinking the problem. There are, sadly, no developer tools to simulate your creativity.

The more mundane approaches are to reduce the amount of wasted effort your application expends and to harness more of the computer system's power. To do that you first need to know where your application is spending its time and learn what resources it's using. In other words, to make your application run faster, you need to know what's slowing it down. This is a process known as performance analysis. And for that, Xcode offers a number of very powerful tools.

Xcode's performance analysis tools are strictly for native binaries and Java. To my knowledge, there are no performance analysis tools for AppleScript.

This chapter covers the four performance analysis tools that you can launch directly from within Xcode: Shark, Sampler, MallocDebug, and ObjectAlloc. The Developers tools CD that you used to install Xcode contains many other specialized tools for helping you identify and optimize your application. There ...

Get Beginning Xcode® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.