On 6 Jul 2011, at 7:38 AM, Eric E. Dolecki wrote:
> I am wondering if I need to recreate MPMediaQuery each time I want to
> use it and am changing grouping type and filter predicates... or can I
> simply create that once and then change filters, etc. on it. Wondering
> if it would speed my code up.
MPMediaQuery seems to be mutable. You can add and remove filters. The ability
to remove filters doesn't make sense to me unless you can reuse the query. I
don't know from experience. Maybe if you tried it, and checked for accuracy,
leaks, and zombies, you'd know.
But if you're wondering whether it would speed your code up, you can find out
for yourself: Have Instruments profile it as-is. If it turns out that the
alloc/init of queries takes up a significant part of your execution time (I'd
be surprised it it did), then you can try caching instances, and seeing for
yourself whether it helps.
Don't waste your time guessing what your app needs. Measure.
— F
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]