Database Reference
In-Depth Information
The default Core Data template includes the following tools to help you tune and
monitor performance:
Core Data Fetches Instrument: Captures fetch count and duration of fetch
operations. This will help you balance the number of fetch requests versus the
size of each request.
Core Data Cache Misses Instrument: Captures information about fault events
that result in cache misses. This can help diagnose performance in low-memory
situations.
Core Data Saves Instrument: Captures information on managed object context
save events. Writing data out to disk can be a performance and battery hit, so
this instrument can help you determine whether you should batch things into one
big save rather than many small ones.
Since you clicked on the Core Data Fetches tool, the details section at the bottom
of the Instruments window shows more information about each fetch that occurred.
Each of the three rows corresponds to the same line of code in the app. The first
two rows are private Core Data calls that are generated by lines of code in the app,
so you can ignore them.
Pay attention to the last row, though. This row includes the Objective-C versions of
the caller , fetch count and fetch duration in microseconds.
Employee Directory imports 50 employees. Since the fetch count shows 50, the app
is fetching all employees from Core Data at the same time. That's not very efficient!
The Core Data Fetches tool corroborates your experience that the fetch is slow and
is easily noticeable, as you can see it takes about 2,000 microseconds (2 seconds).
The app has to complete this fetch before it makes the table view visible and ready
for user interaction.
Note: Depending on your Mac, the numbers onscreen (and the thickness of
the bars) might not match those shown in these screenshots. Faster Macs will
 
Search WWH ::




Custom Search