← Back to release summary
Intensive throttling of Javascript timer wake ups
- Category
- Performance
- Type
- New or changed feature
- Status
- Enabled by default (Chrome 86)
- Intent stage
- Shipped
Summary
In a Window whose top Window has been hidden for 5 minutes and which is not opted out from intensive wake up throttling, a timer task with non-zero timeout can run:
- on a 1-second aligned wake up if:
- the timer task's nesting level is < 5, or,
-the Window is same-origin with the top Window and at least 1 minute has elapsed since the last timer task with nesting level >= 5 has run in any Window in the tree that is same-origin with the top Window
- on a 1-minute aligned wake up, otherwise.
Motivation
Local experiments demonstrate that this intervention extends battery life.
Standards & signals
- Specification: https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html
- Firefox: No signal — In Firefox 77.0.1, a recursive setTimeout with a 10 ms timeout runs every 10 ms.
- Safari: Shipped/Shipping — In Safari 13.1.1, a recursive setTimeout with a 10 ms timeout runs:
< 2.5 minutes in background: Every 250 ms - 30 seconds
> 2.5 minutes in background: Every 40 seconds
- Web developers: No signals — There were strong negative signals for page freezing on desktop https://groups.google.com/a/chromium.org/g/blink-dev/c/sotCDcI-E7Y/m/boghpXElDAAJ. This intervention provides similar performance benefits, but addresses breakages raised by Web developers. We will update this section when we get signals from Web developers specifically on this improved intervention.
- Tracking bug: https://crbug.com/1075553
Docs: https://docs.google.com/document/d/11FhKHRcABGS4SWPFGwoL6g0ALMqrFKapCk5ZTKKupEk/edit?usp=sharing
Explainers: https://docs.google.com/document/d/105Hlbcb1mTV06bT9aDpwBotY13eZiKV5Hl4PW5LlyeE/edit?usp=sharing
View on chromestatus.com