If my Author
NSManagedObject
model has a authorID
attribute (determined by the server), will an NSFetchRequest
perform better if the NSPredicate
filters by authorID
rather than the complete Author
object? Let's say I'm fetching all Book
NSManagedObject
s by a certain author
. Which predicateFormat
is better?
[NSPredicate predicateWithFormat:@"author = %@", anAuthor]
or
[NSPredicate predicateWithFormat:@"author.authorID = %@", anAuthor.authorID]
What's the best way to profile this? I have Core Data testing working with OCUnit
(SenTestingKit
). Does iOS have something like Ruby's Benchmark module?