[webkit-dev] Web Components development will continue in a branch in near future

Maciej Stachowiak mjs at apple.com
Wed Feb 19 14:50:06 PST 2014


On Feb 18, 2014, at 2:32 PM, Bem Jones-Bey <bjonesbe at adobe.com> wrote:

>> Thanks, Adam. We hope that we will be successful implementing shadow DOM as well.
>> 
>> Do you have any more specific pointers that Ryosuke et al could look at for the O(N^2) algorithm? Like a commit range or a function to look at?
> 
> 
> I think it may be: https://codereview.chromium.org/24350009

Thanks for the pointer, Bem!


On Feb 18, 2014, at 3:09 PM, Adam Barth <abarth at webkit.org> wrote:

> It appears that WebKit still contains some N^2 algorithms in render tree construction:
> 
> var t = Date.now();
> for (var i = 0; i < 5000; ++i)
>   document.body.appendChild(document.createElement('div'));
> document.body.offsetTop;
> document.body.textContent = Date.now() - t;
> 
> Here's a jsfiddle if you'd like to experiment yourself:
> 
> http://jsfiddle.net/vwG2J/2/
> 
> In today's WebKit nightly build, the code above reports a runtime of ~96.  If I multiply the loop bound by a factor of ten, the runtime goes up to ~7625, which is a factor of 79.4 (i.e., roughly quadratic).  By way of contrast, in today's Chrome canary build, the code above reports a runtime of ~30.  If I multiply the loop bound by a factor of ten, the runtime goes up to ~264, which is a factor of 8.8 (i.e., roughly linear).


Thanks for the test case, Adam!

Filed as: <https://bugs.webkit.org/show_bug.cgi?id=129065>.


I think it's a fair point that we should evaluate performance impact of our Shadow DOM implementation in a context that has this bug fixed (and other related issues if we can find them), to get a fair comparison. I also think it is sensible to use a branch (as Ryosuke suggested).


Regards,
Maciej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20140219/bc87c3b9/attachment.html>


More information about the webkit-dev mailing list