GNOME Bugzilla – Bug 688069
DigitalClock: Set last_sunrise/sunset on update
Last modified: 2012-11-12 22:25:08 UTC
This had been forgotten, resulting in a complete update of every world clock, every second. This was the cause of the pretty high CPU usage when using a few world clocks.
Created attachment 228668 [details] [review] DigitalClock: Set last_sunrise/sunset on update
Review of attachment 228668 [details] [review]: I think last_sunrise/sunset are just updated in the wrong place, so I can remove these lines, will have a closer look tomorrow ...
Review of attachment 228668 [details] [review]: I think last_sunrise/sunset are just updated in the wrong place, so I can probably remove these lines, will have a closer look tomorrow ...
Review of attachment 228668 [details] [review]: Wow, bugzilla is crazy ...
Created attachment 228696 [details] [review] DigitalClock: Set last_sunrise/sunset on update DigitalClock: Set last_sunrise/sunset on update This was done in the wrong place, resulting in a complete update of every world clock, every second. This caused a pretty high CPU usage when using a few world clocks. Also use a new _needs_update attribute for StandaloneClock instances to ensure a full DigitalClock update after a StandaloneClock has been added. (This prevents an empty StandaloneClock until the next full update. This wasn't necessary before, as the bug already caused the DigitalClock to be completely updated on every update call.) https://bugzilla.gnome.org/show_bug.cgi?id=688069
Created attachment 228741 [details] [review] [PATCH] DigitalClock: Set last_sunrise/sunset on update Small change
Created attachment 228834 [details] [review] DigitalClock: Set last_sunrise/sunset on update DigitalClock: Set last_sunrise/sunset on update This was done in the wrong place, resulting in a complete update of every world clock, every second. This caused a pretty high CPU usage when using a few world clocks. Also use a new _standalone_is_new attribute for DigitalClock instances to ensure a full DigitalClock update after a StandaloneClock has been added. (This prevents an empty StandaloneClock until the next full update. This wasn't necessary before, as the bug already caused the DigitalClock to be completely updated on every update call.)
Review of attachment 228834 [details] [review]: Just a tiny comment... ::: gnomeclocks/world.py @@ -184,2 +186,4 @@ if self.standalone: self.standalone.update(img, t, self.sunrise, self.sunset) + if self._standalone_is_new: + self._standalone_is_new = False Just set it to False, one less line :)
Created attachment 228835 [details] [review] DigitalClock: Set last_sunrise/sunset on update Fixed.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.