Bug 229960

Summary: Add layout test for performance of adding children to a shadow host
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, darin, gsnedders, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 229680    
Attachments:
Description Flags
patch
none
patch none

Description Antti Koivisto 2021-09-06 07:05:40 PDT
It was very O(n^2).
Comment 1 Antti Koivisto 2021-09-06 07:09:43 PDT
Created attachment 437411 [details]
patch
Comment 2 Antti Koivisto 2021-09-06 11:11:03 PDT
Created attachment 437426 [details]
patch
Comment 3 Ryosuke Niwa 2021-09-06 14:11:28 PDT
Comment on attachment 437426 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437426&action=review

> LayoutTests/fast/shadow-dom/host-child-append-performance.html:11
> +for (i = 0; i < 10000; ++i)
> +    host.appendChild(document.createElement("div"));

Wouldn't this test start passing on a very fast machine even if this got broken
or start failing on a very slow machine without any regression?
I guess there is no way around it.
Comment 4 Antti Koivisto 2021-09-06 23:11:58 PDT
In theory, but this is really far from passing, especially on debug build.
Comment 5 Antti Koivisto 2021-09-06 23:13:14 PDT
(without the fix that is)
Comment 6 EWS 2021-09-06 23:34:42 PDT
Committed r282073 (241373@main): <https://commits.webkit.org/241373@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437426 [details].
Comment 7 Radar WebKit Bug Importer 2021-09-06 23:35:22 PDT
<rdar://problem/82808890>