iOS CoreData batch insert?

Check out the Efficiently Importing Data chapter from the Core Data Programming Guide.

I’m currently having the same problems as you, only I’m inserting 10000 objects and it takes around 30s, which is still slow for me. I’m doing a [managedObjectContext save] on every 1000 managed objects inserted into the context (in other words, my batch size is 1000). I’ve experimented with 30 different batch sizes (from 1 to 10000), and 1000 seems to be the optimum value in my case.

Leave a Comment