W3C home > Mailing lists > Public > public-web-perf@w3.org > June 2011

Re: setImmediate should allow the UA to delay the event

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 30 Jun 2011 07:33:20 +0000 (UTC)
To: Boris Zbarsky <bzbarsky@MIT.EDU>
cc: "public-web-perf@w3.org" <public-web-perf@w3.org>
Message-ID: <Pine.LNX.4.64.1106300732350.20871@ps20323.dreamhostps.com>
On Thu, 30 Jun 2011, Boris Zbarsky wrote:
>
> 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.

What's the difference between setImmediate() and setTimeout(..., 0)?

Is it just that it uses a different task source? (i.e. can be prioritised 
differently relative to setTimeout() calls by the event loop?)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 30 June 2011 07:33:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 30 June 2011 07:33:47 GMT