• 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: Optimizing View Drawing Code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimizing View Drawing Code


  • Subject: Re: Optimizing View Drawing Code
  • From: Stephen Blinkhorn <email@hidden>
  • Date: Fri, 8 Jan 2010 10:18:55 -0600


On 7 Jan 2010, at 18:16, Nick Zitzmann wrote:


On Jan 7, 2010, at 4:58 PM, Stephen Blinkhorn wrote:

The real cause seems to be all the view setup messaging that needs to happen after I mark the view with setNeedsDisplay:YES. My top hit in shark is: objc_msgSend (seems wrong for an app doing mostly DSP :).

I should have mentioned earlier - regardless of top up or bottom down Shark results - I'm pretty sure the cause of my high CPU is the behind the scenes view setup prior to drawing that Cocoa does.


I can verify this by removing all drawing code from my drawRect: method but gaining almost no extra performance (CGLayers are fast :). Even with an empty drawRect: method if I comment out the setNeedsDisplay:YES line in the meter then the CPU drops to almost zero. I'm looking at 15-20% CPU on a dual core 2.3GHz machine - quite a lot really.

Of course, GUI updates have a lower priority than all the audio stuff but it would help to get the usage down.

Thanks,
Stephen


That's because you're probably looking at the bottom-up view, which I think is still the default view in Shark, and it's not always helpful in ObjC programs. Did you try looking at the top-down view?


Nick Zitzmann
<http://www.chronosnet.com/>


_______________________________________________

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: Optimizing View Drawing Code
      • From: Markus Spoettl <email@hidden>
References: 
 >Optimizing View Drawing Code (From: Stephen Blinkhorn <email@hidden>)
 >Re: Optimizing View Drawing Code (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Julian date
  • Next by Date: Re: Implementing search field in core-data app
  • Previous by thread: Re: Optimizing View Drawing Code
  • Next by thread: Re: Optimizing View Drawing Code
  • Index(es):
    • Date
    • Thread