• 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: 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


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

  • Prev by Date: Re: What NSEvent contains text from Ink input? [Solution]
  • Next by Date: Re: What NSEvent contains text from Ink input? [Solution]
  • Previous by thread: NSPredicate performance considerations
  • Next by thread: Re: NSPredicate performance considerations
  • Index(es):
    • Date
    • Thread