Bug 229960 - Add layout test for performance of adding children to a shadow host
Summary: Add layout test for performance of adding children to a shadow host
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 229680
  Show dependency treegraph
 
Reported: 2021-09-06 07:05 PDT by Antti Koivisto
Modified: 2021-09-06 23:35 PDT (History)
5 users (show)

See Also:


Attachments
patch (1.59 KB, patch)
2021-09-06 07:09 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (1.66 KB, patch)
2021-09-06 11:11 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>