13 - Profiling Core Data
iOS Book Club
Jasdev Singh
Slide 2
Slide 2 text
SQL Debug Output
The easiest way to gain insight into what SQL is doing
under the hood of Core Data is to enable debug output
by adding
-com.apple.CoreData.SQLDebug 1
as a launch argument in the Xcode Scheme Editor.
Slide 3
Slide 3 text
SQL Pro Tip
Once you extract underlying queries from SQL, you can
use SQL's EXPLAIN command to get a further breakdown
on the execution plan for it.
Slide 4
Slide 4 text
Core Data Instruments
Predefined templates include the Fetches, Saves, Faults,
and Cache Misses instruments
Slide 5
Slide 5 text
Threading Guard
Add the launch argument, -
com.apple.CoreData.ConcurrencyDebug 1 to have Core
Data throw an exception whenever a managed object or
managed object context are accessed from the wrong
queue.
Slide 6
Slide 6 text
Summary
4 Launch flags to help investigate issues
4 Pair SQL output with EXPLAIN
4 Core Data instruments are !