← Back to team overview

dx-packages team mailing list archive

[Bug 1533911] Re: Decrease CPU usage of datetime by events

 

** Changed in: indicator-datetime (Ubuntu)
     Assignee: Charles Kerr (charlesk) => (unassigned)

-- 
You received this bug notification because you are a member of DX
Packages, which is subscribed to indicator-datetime in Ubuntu.
Matching subscriptions: dx-packages
https://bugs.launchpad.net/bugs/1533911

Title:
  Decrease CPU usage of datetime by events

Status in indicator-datetime package in Ubuntu:
  Triaged

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


References