touch-packages team mailing list archive
-
touch-packages team
-
Mailing list archive
-
Message #128727
[Bug 1533911] [NEW] Decrease CPU usage of datetime by events
Public bug reported:
Currently in ./src/wakeup-timer-mainloop.cpp
the g_timeout_add_full function is used to call intervals:
const auto now = m_clock->localtime();
const auto difference_usec = g_date_time_difference(m_wakeup_time.get(), now.get());
const guint interval_msec = std::abs(difference_usec) / 1000u;
g_debug("%s setting wakeup timer to kick at %s, which is in %zu seconds",
G_STRFUNC,
m_wakeup_time.format("%F %T").c_str(),
size_t{interval_msec/1000});
m_timeout_tag = g_timeout_add_full(G_PRIORITY_HIGH,
interval_msec,
on_timeout,
this,
nullptr);
More information:
https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-timeout-add-full
The grouping of timers to fire at the same time results in a more power and CPU efficient behavior
That's why I would recommend to use:
g_timeout_add_seconds_full ()
instead
** Affects: indicator-datetime (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to indicator-datetime in
Ubuntu.
https://bugs.launchpad.net/bugs/1533911
Title:
Decrease CPU usage of datetime by events
Status in indicator-datetime package in Ubuntu:
New
Bug description:
Currently in ./src/wakeup-timer-mainloop.cpp
the g_timeout_add_full function is used to call intervals:
const auto now = m_clock->localtime();
const auto difference_usec = g_date_time_difference(m_wakeup_time.get(), now.get());
const guint interval_msec = std::abs(difference_usec) / 1000u;
g_debug("%s setting wakeup timer to kick at %s, which is in %zu seconds",
G_STRFUNC,
m_wakeup_time.format("%F %T").c_str(),
size_t{interval_msec/1000});
m_timeout_tag = g_timeout_add_full(G_PRIORITY_HIGH,
interval_msec,
on_timeout,
this,
nullptr);
More information:
https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-timeout-add-full
The grouping of timers to fire at the same time results in a more power and CPU efficient behavior
That's why I would recommend to use:
g_timeout_add_seconds_full ()
instead
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/indicator-datetime/+bug/1533911/+subscriptions
Follow ups