-
Notifications
You must be signed in to change notification settings - Fork 28
Existing Intervention to add--setTimeout/setInterval are aligned/clamped to 1 second in many browsers #5
Comments
Chrome on Android additionally completely stops suspends timers in background tabs after 5 minutes: https://code.google.com/p/chromium/codesearch#chromium/src/components/scheduler/renderer/renderer_scheduler_impl.h&rcl=1455769844&l=217 |
We clearly need to spec the 1 second thing and the full suspending that we do on android. So adding the needs spec label. The other thing Chrome is considering is to start doing the full suspension on desktop, like we do on Android. We're considering doing this for cases where we would have killed the background tab due to memory constraints, i.e. suspend tasks in that tab and purge any transient memory (e.g. layout tree, etc). |
We're now also looking at doing a bit more adaptive throttling for background tabs in Chrome on top of this 1 Hz alignment. The reason is that a misbehaving background tab can still end up using a lot of CPU either by having lots of timers or a long running timer. The general idea is outlined here: https://docs.google.com/document/d/1vCUeGfr2xzZ67SFt2yZjNeaIcXGp2Td6KHN7bI02ySo/edit# |
This is shipped in Edge as well now (as of EdgeHTML14). The clamping to 1Hz in background tabs, not anything more intensive. |
Additional context on the original change in Chrome: |
Note, firefox throttles timers to a minimum 1 second delay in the background, but we don't align them. See: |
(As noted in #72, we intend to archive this repository and are thus triaging and resolving all open issues) I filed whatwg/html#7941 for further standardization and linked to this issue for context. |
Safari, Chrome and Firefox all currently have some form of background tab timer coalescing that seems to align/clamp to 1 second. (Firefox/Chrome's behavior differ a bit and it may be useful to web Interop to align.)
The text was updated successfully, but these errors were encountered: