[whatwg] Proposal for separating script downloads and execution

John Tamplin jat at google.com
Tue Feb 8 13:21:25 PST 2011

On Tue, Feb 8, 2011 at 4:13 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> Here's the thing.  Parsing is a black-box behavior.  Nothing says a browser
> needs to do it right before execution, that it needs to happen on the main
> thread, or that it's happening at all.
> For example, for Gecko we have had proposals to parse off the main thread,
> as well as to store parsed script data structures in the cache so on a cache
> hit we just load the already-parsed data.  We've also had proposals to parse
> eagerly when priming the speculative load cache; this could be a good bit
> before the script executes, assuming it ever executes.
> So is control over parsing really just working around quality of
> implementation issues?  Or do you really need to constrain the timing of the
> parse so as to preclude it being done on a background thread, while the
> parser is waiting for a previous script to load?

I think it is useful to provide ignorable hints to browser to indicate that
you want this downloaded but you don't need it parsed right away.  A smarter
browser that does it in another thread or otherwise doesn't impact the user
by doing the parsing is free to ignore them if it chooses.  Of course, if it
doesn't actually avoid the problem, then you will wind up with
comment-out/etc hacks on that browser.

John A. Tamplin
Software Engineer (GWT), Google

More information about the whatwg mailing list