Bulk insert performance
An initial sync saves 100,000 records into Core Data, memory climbs to 1GB and the app gets killed, and the UI freezes the whole time. What do you think the causes are?
An initial sync saves 100,000 records into Core Data, memory climbs to 1GB and the app gets killed, and the UI freezes the whole time. What do you think the causes are?
The cause is creating 100,000 objects on the main context and saving once at the end. An NSManagedObject stays registered in the context until the save, so memory piles up, and the work is on the main queue, so the UI freezes.
PersistenceShort answerIntro
A new iOS project has to store a favorites list, the login session, downloaded PDFs, and…
#core-data
PersistenceShort answerBasics
Which requirements push you to Core Data (or SwiftData) instead of UserDefaults or a…
#core-data
PersistenceShort answerBasics
You have a bug where a screen backed by Core Data adds an item but the list never…
#core-data
PersistenceMultiple choiceBasics
This is a news app on Core Data. You fetched an Article on a background context…
#core-data