Re: [NSArray filteredAraryUsingPredicate:] performance?
Re: [NSArray filteredAraryUsingPredicate:] performance?
- Subject: Re: [NSArray filteredAraryUsingPredicate:] performance?
- From: Graham Cox <email@hidden>
- Date: Fri, 22 Oct 2010 14:32:36 +1100
On 22/10/2010, at 2:19 PM, Abhi Beckert wrote:
> in this case — don't need to worry about performance or memory consumption — as there won't ever be many products per category.
> How much does performance/memory suffer from using filteredArrayUsingPredicate?
You state it doesn't matter, then you worry that it might.
With any question about optimisation, the question can only be answered by measuring the performance to see if it falls short of your requirements or not. Since you don't say what your requirements are and have not measured the performance against them, nobody can answer this.
All I will say is that on Mac (as opposed to iOS) filtering using a predicate is "fast enough" up to many thousands of objects and I've found it adequate for my needs, but YMMV. You'd probably be unable to match its performance by doing the filtering yourself, though you could beat it by changing your storage so that it is organised into sets that already match certain criteria. Also, as you're caching the result you'll only get hit once or whenever the predicate or content changes.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden