Bad performance of Core Data "save" operation on the managedObjectContext Bad performance of Core Data "save" operation on the managedObjectContext sqlite sqlite

Bad performance of Core Data "save" operation on the managedObjectContext


You should call saveContext several times during the batch insert, and then call reset to "forget" the previous inserted managed objects. For example in my case I save the context every 100 objects. Moreover you should create a dedicated context for the import and optimize it (by setting the undomanager to nil, since you don't need to roolback/undo the whole insert).Read here: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdImporting.html


Saving 13.000 items is going to take a while.

Are the 13.000 items only saved when you first start the app, if so why not just supply the database as a payload with the app.So that when the database isn't already there just copy the one from the bundle.