UpdateTimerManager causes more wake-ups than needed
Categories
(Toolkit :: Application Update, defect)
Tracking
()
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.
Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D171765
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D172741
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6ba6425f55a1
https://hg.mozilla.org/mozilla-central/rev/20371cd748ef
https://hg.mozilla.org/mozilla-central/rev/9f39188a60d2
Description
•