[CD] programmatically inserting MO in MOC gets slower with number of items
[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