Re: Node append

On 9/20/11 4:48 PM, Robin Berjon wrote:
>> I can probably live with overloading things like appendChild to take arrays as long as we keep in mind that this will slow down every single appendChild call in the common case of a node being passed.  Presumably we're ok with this, since we're discussing it.
>
> I would assume that it depends on how much of a hit we're talking about.

It really depends on what other work is involved in the appendChild 
call, obviously.

In the case of Gecko today, I would expect about a 30-40% hit or so, 
without having actually measured carefully.  We're working on reducing 
that, but also working on speeding up the common case, of course.  Where 
the final hit of an overloaded method compared to a non-overloaded one 
will converge is still an open question and likely to depend on 
particular hardware architectures, implementation strategies, etc... 
(e.g. if you make both slow enough you could obviously have no 
appreciable hit for the overloaded case).

-Boris

Received on Tuesday, 20 September 2011 20:56:17 UTC