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

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

From: David Bruant <bruant@enseirb-matmeca.fr>
Date: Thu, 12 Nov 2009 18:21:20 -0800
Message-ID: <4AFCC2A0.1030202@enseirb-matmeca.fr>
Hi,

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.
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.

But what is this "give" ? Without the DOM API, this "give" means
"sending a string through the postMessage() method" and the "append"
means "rightPlace.innerHTML = stringContainingAPartOfThePage".
However, with the DOM API, each worker could build independantly its
documentFragment, send it to the browsing context which will "append"
(appendChild) it in the right place.

Building the page requires 3 main operations :
- getting the content (can be parallelized with the workers which can
make XMLHttpRequests)
- building a DOM tree from the content
- rendering (cannot be parallelized because must occur in the browsing
context)

Without the DOM API, the second step cannot be parallelized in the
WebWorkers.

I understand that the whole DOM API is not useful for the WebWorkers,
but, could a reduced API (sufficient to describe the tree structure of a
document) be available to the web workers to have a chance to
parallelize the tree structuration of the content (and then reduce its
cost) ?

Thanks,

David
Received on Thursday, 12 November 2009 18:21:20 UTC

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