• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSPredicate performance considerations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSPredicate performance considerations
      • From: Prachi Gauriar <email@hidden>
References: 
 >NSPredicate performance considerations (From: Prachi Gauriar <email@hidden>)
 >Re: NSPredicate performance considerations (From: mmalcolm crawford <email@hidden>)
 >Re: NSPredicate performance considerations (From: Prachi Gauriar <email@hidden>)

  • Prev by Date: Distrubuted Objects + NSAttributedString passed via dictionary results in archiver exceptions in server process?
  • Next by Date: Re: NSPredicate performance considerations
  • Previous by thread: Re: NSPredicate performance considerations
  • Next by thread: Re: NSPredicate performance considerations
  • Index(es):
    • Date
    • Thread