I will be doing an occiasional import from XML into core data. I have around 50k entities that will be added. My question is how often should I call [managedObjectContext save:&error]. For every new entity added, or every x entities, or just at the end of the 50k import?
I currently am calling it for each entity and tried only doing it for around every 10k and import speed went up drastically but after the first 30k it would crash with:
*** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <NSCFSet: 0x13e760> was mutated while being enumerated.'
Before I spend too much time trying to diagnose what is going on there I figured I'd check if its ok to not call save on every entity?
Is the # of entities before calling save limited by the amount of memory those entities are using?