• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[CD] programmatically inserting MO in MOC gets slower with number of items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[CD] programmatically inserting MO in MOC gets slower with number of items


  • Subject: [CD] programmatically inserting MO in MOC gets slower with number of items
  • From: Volker Runkel <email@hidden>
  • Date: Thu, 21 Sep 2006 12:10:38 +0200

Dear List,

Short: When creating a batch of MOs, creation time gets slower with number of MOs.


Long:

I have an array of file locations (path), for each I create a managed object in my MOC. After creating one object I set one of its values (a date/time referring to the paths creation, which is also stored in the array).

I do only have one MOC that uses a XMLType store. When creating MOs from that list with

[NSEntityDescription insertNewObjectForEntityForName:@"recording" inManagedObjectContext:[self managedObjectContext]];

the creation gets slower and slower... for the first ten objects I need around 200 ms on my machine, after 200 objects it takes more than 1200ms for the creation of then mos ... To cycle through the array I use a NSObjectEnumerator and prior to MO creation I check if the file does exist via a NSFileManager

[manager fileExistsAtPath:objectToEval isDirectory:&isDir] and I only add such entries that exist as files.

I use a NSArrayController which uses the same MOC and is connected to that MO for display in a GUI (NSTableView).


Is it something I am doing wrong?


TIA,

Volker


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: [CD] slow insertion with relationship ... SOLVED
      • From: Volker Runkel <email@hidden>
    • Re: [CD] programmatically inserting MO in MOC gets slower with number of items II
      • From: Volker Runkel <email@hidden>
  • Prev by Date: Where the data gets stored ?
  • Next by Date: Re: Where the data gets stored ?
  • Previous by thread: Re: Where the data gets stored ?
  • Next by thread: Re: [CD] programmatically inserting MO in MOC gets slower with number of items II
  • Index(es):
    • Date
    • Thread