Re: NSPredicate performance considerations
Re: NSPredicate performance considerations
- Subject: Re: NSPredicate performance considerations
- From: mmalcolm crawford <email@hidden>
- Date: Sun, 20 Nov 2005 16:34:33 -0800
On Nov 20, 2005, at 3:35 PM, Prachi Gauriar wrote:
Hi everyone. I've finally gotten around to playing with Core Data
and I had a general question about performance considerations when
using predicates. If I need to retrieve objects that fulfill a
certain condition, say all objects in a to-many relationship whose
value for property p is less than c, is it better to get all the
objects and manually do the comparison or use a predicate?
Neither of the examples you show involves an explicit fetch, so it's
not entirely clear what you're comparing. For the two examples you
show, it's *likely* the first will be faster (since
filteredArrayUsingPredicate: *may* benefit from internal
optimisation) but (your assertion about premature optmisation
notwithstanding :-) you should profile to check...
For suggestions for optimising fetch behaviour, see:
<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/
Articles/cdFetching.html>
an for optimising predicates, see:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
Predicates/Articles/pUsing.html#//apple_ref/doc/uid/TP40001794-SW2>
mmalc
_______________________________________________
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