W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2011

Re: modifying the DOM WAS: Node append

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 06 Oct 2011 08:05:14 -0400
Message-ID: <4E8D997A.4010600@mit.edu>
To: Sean Hogan <shogun70@westnet.com.au>
CC: Ojan Vafai <ojan@chromium.org>, Anne van Kesteren <annevk@opera.com>, Aryeh Gregor <ayg@aryeh.name>, Erik Arvidsson <arv@chromium.org>, Olli@pettay.fi, Robin Berjon <robin@berjon.com>, www-dom@w3.org, Alex Russell <slightlyoff@chromium.org>
On 10/6/11 7:40 AM, Sean Hogan wrote:
> One of the potential benefits of these proposed methods (when called
> with an array-ish of nodes) is improved performance as several DOM calls
> are replaced with one.

I'm actually somewhat dubious of that... in particular, for the existing 
methods a good type-specializing JIT can generate pretty good code to 
call into the DOM fast (much faster than current UAs; at least some UAs 
are working on this long-term).  For a method that needs to deal with 
overloads and all the resulting complexity just the time needed for that 
might eat up any wins from only having to go from JS to C++ once... 
especially if the resulting C++ has to keep calling back into JS a bunch 
of times to actually get the items out of the array-ish.  This can be 
special-cased for nodelists, of course....

The point being that the performance tradeoff is actually not obvious here.

Received on Thursday, 6 October 2011 12:05:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:36:59 UTC