• 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
Reduce CPU usage in screensaver?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reduce CPU usage in screensaver?


  • Subject: Reduce CPU usage in screensaver?
  • From: Gabriel Zachmann <email@hidden>
  • Date: Thu, 24 Sep 2009 20:43:09 +0200

I wrote a screen saver that basically zooms images at a frame rate of 10 frames/sec.

When running, it uses about 60% CPU !
This could be a bit annoying sometimes, if there are other compute intensive processes running, such as video conversions.


Is there anything I could do to reduce the CPU usage of my screensaver?
(Other than reducing the frame rate?)

The method that seems to be the most compute intensive one is the following:

[imageRep_ drawInRect: zoomed_frame_ fromRect: NSZeroRect operation: NSCompositeCopy fraction: 1.0];

It gets invoked every frame (in -animateOneFrame, which computes a slightly larger zoomed_frame_ every frame).
I analyzed my screen saver with Shark, and it says that this method call costs about 85%.


If it helps, here is the complete source code: http://zach.in.tu-clausthal.de/tmp/ArtSaver.m

Any ideas or hints will be highly appreciated.

Best regards,
Gabriel.




Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: Reduce CPU usage in screensaver?
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Core Data: relationship 'too large' when saving
  • Next by Date: Re: Reduce CPU usage in screensaver?
  • Previous by thread: re: Core Data: relationship 'too large' when saving
  • Next by thread: Re: Reduce CPU usage in screensaver?
  • Index(es):
    • Date
    • Thread