Re: modifying the DOM WAS: Node append

On 10/6/11 8:39 AM, Sean Hogan wrote:
>> The point being that the performance tradeoff is actually not obvious
>> here.
>
> Thanks. My reading of that is that for an array of nodes the performance
> can't possibly be better than calling (say) appendChild() separately for
> each node, due to all the JS <-> C++ transitions. Is that correct?

No.  A correct statement is that the performance may be better or worse 
or about the same, depending on the performance of the DOM bindings 
involved, the level of coupling between the DOM implementation and the 
JS engine (e.g. can the DOM implementation get its hands directly on the 
underlying storage of a JS array?), the speed of the native-code APIs 
for extracting elements from an array, etc, etc.

-Boris

Received on Thursday, 6 October 2011 13:44:23 UTC