Bug 204862 - clock applet updates every second even when seconds aren't showing
Summary: clock applet updates every second even when seconds aren't showing
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-panel
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ray Strode [halfline]
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: wakeup
TreeView+ depends on / blocked
 
Reported: 2006-08-31 22:21 UTC by Arjan van de Ven
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-09-01 18:22:15 UTC


Attachments (Terms of Use)
patch to poll less frequent when not showing seconds (416 bytes, patch)
2006-08-31 22:22 UTC, Arjan van de Ven
no flags Details | Diff
patch to make the clock applet wakeup event be at exactly the right time for redrawing rather than polling for it (1.35 KB, patch)
2006-09-01 07:33 UTC, Arjan van de Ven
no flags Details | Diff

Description Arjan van de Ven 2006-08-31 22:21:54 UTC
Description of problem:

the clock applet updates itself every second, even when the clock isn't
configured to show seconds. This of course eats power when (tickless) idle.

Solution is simple, update less frequent when not showing seconds.. see attached
patch

Comment 1 Arjan van de Ven 2006-08-31 22:22:00 UTC
Created attachment 135345 [details]
patch to poll less frequent when not showing seconds

Comment 2 Arjan van de Ven 2006-09-01 07:31:45 UTC
ok that patch was a fugly hack; this one is nicer:
Instead of doing a repeating constant timer, calculate the time to the next
redraw event and just make the timer not rearm.

This has 2 advantages
1) it is more accurate; the old clock was only second accurate, the new clock is
much more accurate
2) there are no spurious timer wake events at all, the only wake events that
happen have real work to do


strace of the new clock to show how nice it works:
9:26:23.634270 poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8,
events=POLLIN|POLLPRI}, {fd=10, events=POLLIN|POLLPRI}, {fd=11,
events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=14,
events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}, {fd=15,
events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}], 10, 36366) = 0
09:27:00.000822 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074,
...}) = 0
09:27:00.001303 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074,
...}) = 0
09:27:00.001485 ioctl(3, FIONREAD, [0]) = 0
09:27:00.001581 poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8,
events=POLLIN|POLLPRI}, {fd=10, events=POLLIN|POLLPRI}, {fd=11,
events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=14,
events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}, {fd=15,
events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}], 10, 0) = 0
09:27:00.001998 write(3,
"5\20\4\0@\0\200\1!\0\200\1=\0\30\0\231\4\5\0A\0\200\1@"..., 652) = 652
09:27:00.002103 ioctl(3, FIONREAD, [0]) = 0
09:27:00.002170 poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8,
events=POLLIN|POLLPRI}, {fd=10, events=POLLIN|POLLPRI}, {fd=11,
events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=14,
events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}, {fd=15,
events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}], 10, 59999) = 0
09:28:00.001798 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074,
...}) = 0
09:28:00.002202 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074,
...}) = 0


notice how all the procesing happens exactly in the first few microseconds of
the new minute

Comment 3 Arjan van de Ven 2006-09-01 07:33:12 UTC
Created attachment 135362 [details]
patch to make the clock applet wakeup event be at exactly the right time for redrawing rather than polling for it

Comment 4 Matthias Clasen 2006-09-01 17:33:22 UTC
Compare
http://bugzilla.gnome.org/show_bug.cgi?id=348749

Comment 5 Matthias Clasen 2006-09-01 18:22:15 UTC
Fixed in 2.15.92-6.fc6


Note You need to log in before you can comment on or make changes to this bug.