Re: [CD] programmatically inserting MO in MOC gets slower with number of items II
Re: [CD] programmatically inserting MO in MOC gets slower with number of items II
- Subject: Re: [CD] programmatically inserting MO in MOC gets slower with number of items II
- From: Volker Runkel <email@hidden>
- Date: Fri, 22 Sep 2006 10:27:52 +0200
Hi,
thanks for the answer. Before even thinking about performance I first
evaluated memory allocations with ObjectAlloc. That looks rather
good, I do not have any memory problems, allocations do take only
place for the objects that remain in the MOC.
Instead of Shark I used Sampler, but I did not find anything helpful.
The NSArrayController is set to automatically prepareContents, but
disabling that did not help. As soon as I do not set the relation
everything is really fast. My guess at the moment is that my "parent"
object NSMutableSet, which holds the one-to-many relationship
internally is causing the problem, but until now I did not find
anything. I am not very used to Sampler or Shark and therefore always
need some runs to get a grip of what they tell me.
Another thing I will try is to create the objects in a second MOC
which I merge when all MOs are created. Maybe a single merge of two
MOC is faster.
I broke down the code to the smallest possible number of lines, and
it just enumerates through an existing NSArray and sets two values
(relationship and filename entry) for each new MO.
Thanks again,
Volker
Do you have a tight loop with an accumulation of autoreleased objects
causing memory exhaustion? Does the Performance section in the
CoreData Programming Guide help you at all?
What do the profiling tools like Shark and ObjectAlloc tell you?
Showing your code often helps, as well.
As djb says, "Profile. Don't speculate."
J.
_______________________________________________
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