On 2014-12-12 7:00 AM, smaug wrote:
On 12/09/2014 12:46 AM, Chris Peterson wrote:
On 12/8/14 2:28 PM, Boris Zbarsky wrote:
On 12/8/14, 3:18 PM, Chris Peterson wrote:
Are Firefox's JS throttling heuristics (e.g. for background tabs)
documented somewhere? Is this policy controlled by SpiderMonkey or
Gecko?

The policy is controlled by Gecko.

The throttling policies are as follows:

1)  Nested setTimeout/setInterval is throttled to a rate determined by
the "dom.min_background_timeout_value", defaulting to 1000ms wait time
between invocations of the repeating timer.

2)  The refresh driver (and hence requestAnimationFrame) is throttled to
1Hz initially, period-doubling every time it fires, more or less.  The
policy is a bit more complicated, since different tabs can actually
affect each other.

Thanks.

In bug 1108483, the Shumway team is considering what the appropriate
user experience should be for SWF content scrolled off screen or in
background tabs. Shumway does not necessarily need to implement the
same
UX as the Flash plugin, but may be affected by Firefox's JS throttling.

Note that we don't do any throttling for JS right now in the "scrolled
off screen" case.

When I wrote that question, I was trying to imagine what "JS scrolled
off screen" might actually mean. :) The only thing that came to mind was
throttling event listener callbacks for page elements off screen.

Not sure what that would mean, but we could throttle iframes scrolled
off the screen, at least cross-domain iframes.

With all of the like buttons on the Web these days, that may prove to be a good idea!

_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to