Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Existing Intervention to add--setTimeout/setInterval are aligned/clamped to 1 second in many browsers #5

Open
toddreifsteck opened this Issue Feb 17, 2016 · 6 comments

Comments

Projects
None yet
6 participants
@toddreifsteck
Copy link

toddreifsteck commented Feb 17, 2016

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.)

@skyostil

This comment has been minimized.

Copy link

skyostil commented Feb 18, 2016

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

@ojanvafai

This comment has been minimized.

Copy link
Member

ojanvafai commented Apr 22, 2016

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).

@skyostil

This comment has been minimized.

Copy link

skyostil commented Sep 6, 2016

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#

@brheenan

This comment has been minimized.

Copy link

brheenan commented Nov 3, 2016

This is shipped in Edge as well now (as of EdgeHTML14). The clamping to 1Hz in background tabs, not anything more intensive.

@bryanmcquade

This comment has been minimized.

Copy link

bryanmcquade commented Dec 28, 2016

Additional context on the original change in Chrome:
https://blog.chromium.org/2011/03/getting-smoother-animated-web-content.html

@wanderview

This comment has been minimized.

Copy link

wanderview commented Mar 1, 2017

Note, firefox throttles timers to a minimum 1 second delay in the background, but we don't align them. See:

https://bugzilla.mozilla.org/show_bug.cgi?id=1284368

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.