Closed Bug 1819128 Opened 2 years ago Closed 2 years ago

UpdateTimerManager causes more wake-ups than needed

Categories

(Toolkit :: Application Update, defect)

defect

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: florian, Assigned: florian)

References

(Blocks 1 open bug, Regressed 2 open bugs)

Details

Attachments

(3 files)

From a power use perspective, it's better to finish all the work that there is to do at once and then let the CPU have uninterrupted sleep for as long as possible.

The current code https://searchfox.org/mozilla-central/rev/a3a9112d4d73d1323eabbc7faa9937cd9aae6465/toolkit/components/timermanager/UpdateTimerManager.jsm#124-126 ensures only one timer is fired at once to avoid negatively impacting responsiveness.

This comment was written more than 12 years ago in bug 604804.

I would say the current way to avoid impacting responsiveness would be to ensure the timer callbacks run at the Idle priority, using idle dispatch. Mike tried to do this in bug 1373408, but unfortunately only covered one of the two cases: https://searchfox.org/mozilla-central/rev/d3a1b5aeaad92f8c3e1fd10305e811161c14b816/toolkit/components/timermanager/UpdateTimerManager.jsm#193,218,220

I think we should:

  • call all update timer callbacks at the idle priority
  • let multiple timers fire at the same time (or even encourage that by reviewing the update delays used by the existing consumers and trying to make them match).

This profile (https://share.firefox.dev/3xSIKDk) shows the current behavior. Bug 1819114 should make it possible to see which update timer is firing when.

Blocks: 1373408
Assignee: nobody → florian
Status: NEW → ASSIGNED
Severity: -- → S3
Pushed by fqueze@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6ba6425f55a1 let UpdateTimerManager fire multiple timer callbacks sequentially using idle dispatch, r=mconley,bytesized. https://hg.mozilla.org/integration/autoland/rev/20371cd748ef make tests pass despite update timers happening closer to each other, r=mconley. https://hg.mozilla.org/integration/autoland/rev/9f39188a60d2 adjust the consumerNotifications.js UpdateTimerManager test, r=bytesized
Regressions: 1823549
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Regressions: 1824669
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: