[whatwg] [WebWorkers] Advocation to provide the DOM API to the workers

Ian Hickson ian at hixie.ch
Tue Dec 1 17:58:50 PST 2009

On Thu, 12 Nov 2009, David Bruant wrote:
> I was waiting for Firefox to stop freezing on the HTML5 spec page (it 
> freezes about one minute each time I visit the one-page version) and I 
> tried to think of a way to "design" this page in a way that wouldn't 
> freeze my browser.

The easiest way is to disable the scripts, which you can do by appending 
?slow-browser to the page's URL, as in:


> One good way I have found would be to cut the whole page into several 
> parts (one the server side, what is already done in the multi-page 
> version) and to launch several workers. Each worker gets one part of the 
> whole page in the background and could give it to the browsing context 
> which will append the right part at the right place.

As others have noted, the slowness turns out to not be parsing, but to be 
a bunch of scripts that are doing various things such as adding the 
sidebar annotations, setting up the <dfn> cross-references, and generating 
the short table of contents.

Plus, since browsers don't have thread-safe DOM implementations, we 
actually can't expose the DOM in workers. Maybe one day. :-)

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list