Re: CoreData/NSManagedObject accessor performance problems
Re: CoreData/NSManagedObject accessor performance problems
- Subject: Re: CoreData/NSManagedObject accessor performance problems
- From: mmalc crawford <email@hidden>
- Date: Sun, 17 Dec 2006 15:49:34 -0800
On Dec 17, 2006, at 3:17 PM, Andrew Bush wrote:
ok, so I got the filterPredicate working. yay :) unfortunately it
appears t be about comparable with the other filtering methods in
terms of speed...presumably it is doing much the same thing.
Please post some code.
It is unlikely that a simple predicate filter operation on a simple
numeric value would cause the sort of effect you're describing.
it appears that sqlite is only storing the data values, so one of
the things that is happening here is for every comparison I am
creating a NSNumber out of a double (stored in sqlite), and then
comparing its doubleValue with the double I am filtering it on.
and the creation of the NSNumber is apparently where the speed hit
is coming from....
Earlier:
so, on the wild, random guess that the slowdown is probably caused
by some kind of serialisation being reversed for each initial call
to each value of each object
Wild random guessing is not helpful: measure using Shark.
If all the managed objects in your array have already been fetched,
and if you're using a simple predicate filter in an array controller,
then Core Data per se is not imposing any additional overhead. You
should be looking elsewhere for the cause.
so..is there some (any) way for me to just get at the raw value
without bothering with the NSNumber stuff? presumably
NSManagedObject stores that somewhere......how can I access it
directly?
You can't. Doing so would subvert part of the raison d'etre of Core
Data, and whatever you might do is very unlikely to be more efficient
than what Core Data itself does anyway.
mmalc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden