Re: NSPredicate performance considerations
Re: NSPredicate performance considerations
- Subject: Re: NSPredicate performance considerations
- From: Chris Hanson <email@hidden>
- Date: Sun, 20 Nov 2005 18:15:55 -0800
On Nov 20, 2005, at 5:37 PM, Prachi Gauriar wrote:
I probably shouldn't have mentioned Core Data at all, since this
was really about using predicates. I just wanted to know whether I
could be liberal in my use of predicates or if I should only
reserve them for special cases. Either way, your answer is
encouraging. Obviously for more specific cases, profiling is the
way to go.
Generally, you should be fine with liberal use of predicates. The
one thing to remember is that when you construct a predicate from a
predicate format string, that format string needs to be parsed.
So if you're going to perform the same filtering repeatedly, create
the predicate once and then re-use it rather than creating it every
time. If you need some simple systematic variation among your
predicates but otherwise the actual structure is identical, you can
use substitution variables and avoid re-parsing.
Fetches are still a bit of a mystery to me, but since I've only
been playing Core Data for a day, I'll save those questions for
later. Thanks.
What do you find mysterious about them, relative to -
filteredArrayWithPredicate:?
-- Chris
_______________________________________________
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