[Efficient Script Yielding] allow the UA to delay the event

I agree we may want to throttle setImmediate in background and non-visible tabs.

Do you think we could go as far as not firing nested setImmediates in background tabs?



-----Original Message-----
From: public-web-perf-request@w3.org [mailto:public-web-perf-request@w3.org] On Behalf Of Boris Zbarsky
Sent: Thursday, June 30, 2011 12:26 AM
To: public-web-perf@w3.org
Subject: setImmediate should allow the UA to delay the event

Both setTimeout and setInterval have this step in their processing:

  * Optionally, wait a further user-agent defined length of time.

I believe it would be a good idea to have this for setImmediate as well. 
  In Gecko's implementation, we are considering introducing a delay into setImmediate invocations in background tabs, minimized windows, etc. 
Not as much of a delay as setTimeout/setInterval are getting, but some delay.

Note that as long as you only examine setImmediate this is not black-box distinguishable from throttling the entire event queue for the relevant browsing context.  You can only tell the difference by comparing order of setImmediate invocation with other events in the event queue.

-Boris

Received on Friday, 1 July 2011 22:27:56 UTC