High performance Core Data
summary
Practical Core Data fixes: use Instruments and sqlite3 to measure real SQL, set fetchBatchSize (example cut memory from 125MB to 20MB), use NSExpression/grouping for counts instead of pulling 60,000 objects, prefetch relationships and use objectID-only background fetches, normalize and tokenise searchable text, store thumbnails on the main entity and full blobs with allowsExternalStorage, and optimize imports by sorting IDs and batching (example import: 5 min → 1 min → <1 min) or use a second PSC for parallel reads.
AI-written summary · about
chapters (16)
- 0:00Introduction to Core Data
- 1:08Core Data basics and setup
- 4:36Measuring Core Data performance
- 8:23Optimizing fetches with batch size
- 11:32Efficient data summation with NSExpression
- 13:39Prefetching relationships for speed
- 14:42Background fetching techniques
- 15:03Writing efficient predicates
- 16:47Improving search performance
- 19:13Data model design tips
- 21:02App launch and migrations
- 21:22Handling bulk updates
- 22:25Importing data efficiently
- 28:53Memory management techniques
- 29:13Concurrency model options
- 34:48Summary and best practices
