Inspecting Performance with Instruments

We’ve looked at a few places where you can make an app faster, but what about the rest of the time? How can you make a method return faster if you don’t know where it’s slow? You can guess, looking at the code with your brow furrowed until you decide to change something, but that’s problematic. Not only could you be ignoring non-obvious performance problems, but in your attempt to fix the issue, you could actually make it slower!

What you need is data, and that’s where Instruments, a performance-analysis and testing tool bundled with Xcode, comes in. Let’s try it out.

In Xcode, open TapALap and select Product Profile or press I. This builds your app in its Release configuration, which performs additional ...

Get Developing for Apple Watch, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.