W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2009

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

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 2 Dec 2009 01:58:50 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0912020155410.1141@hixie.dreamhostps.com>
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.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 1 December 2009 17:58:50 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:19 UTC