ios - Core Data Performance issue while Saving -


i'm using core data of nssqlitestoretype store data in ios app. need store large amount of objects database. improve performance of core data, i'm considering many considerations like:

  1. saving batch wise
  2. saving after loop ends
  3. clearing context manage memory

but taking time save 100k objects. please suggest me best practices improve performance of core data while saving large amounts of data.

  1. you should import on non-ui thread context bound directly persistent store coordinator, not child context of main contex
  2. you should invoke [managedobjectcontext save] once in every several hundreds of new objects inserted, depending on object size , graph complexity. see this answer details
  3. you should wrap batch step 2 in @autoreleasepool block , reset context after save before autorelease block exited. see this answer

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -