• 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: Question about MPMediaQuery
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about MPMediaQuery


  • Subject: Re: Question about MPMediaQuery
  • From: Fritz Anderson <email@hidden>
  • Date: Wed, 06 Jul 2011 09:54:18 -0500

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@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

  • Follow-Ups:
    • Re: Question about MPMediaQuery
      • From: "Eric E. Dolecki" <email@hidden>
References: 
 >Question about MPMediaQuery (From: "Eric E. Dolecki" <email@hidden>)

  • Prev by Date: Re: Delay in reading cookie using NSHttpCookieStorage
  • Next by Date: Re: Question about MPMediaQuery
  • Previous by thread: Question about MPMediaQuery
  • Next by thread: Re: Question about MPMediaQuery
  • Index(es):
    • Date
    • Thread