Measuring Performance with Instruments

To measure an application’s performance, profile it with Instruments. Unfortunately, the option to profile Core Data is not available for physical iOS devices. This means you must profile Core Data on the iOS Simulator instead. Although this is not ideal, it still provides good insight into key Core Data–specific metrics such as fetches, cache misses, and saves.

To profile an application using Instruments, you simply run the application in a different way. Instead of just pressing the Run button, press and hold the Run button to select Profile instead. Try this now and notice how the button changes as Instruments loads. The expected result is shown in Figure 10.7.

Figure 10.7 Profiling an application

Get Learning Core Data for iOS: A Hands-On Guide to Building Core Data Applications 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.