Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/PerformanceTests/ShadowDOM/v1-host-child-append.html

Issue 1995203002: Rewrite Shadow DOM distribution engine to support partial synchronous distribution for v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: No longer FAIL: imported/wpt/shadow-dom/HTMLSlotElement-interface.html Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/runner.js"></script>
3 <!-- This is a micro benchmark to catch an unintentional regression.
4 If the reason of a regression is clear, it is okay.
5 We do not have to optimize the result of the benchmark. -->
6 <div id="wrapper">
7 <div id="host"></div>
8 </div>
9 <script>
10 'use strict';
11 const numChildOfHost = 50;
12 const numDivsInShadow = 20;
13 const loops = 20;
14
15 const slot1 = document.createElement('slot');
16 slot1.setAttribute('name', 'slot1');
17 const slot2 = document.createElement('slot');
18 slot2.setAttribute('name', 'slot2');
19 const shadowRoot = host.attachShadow({mode: 'open'});
20 shadowRoot.appendChild(slot1);
21 shadowRoot.appendChild(slot2);
22
23 for (let i = 0; i < numDivsInShadow; ++i) {
24 let div = document.createElement('div');
25 shadowRoot.appendChild(div);
26 }
27
28 function run() {
29 for (let i = 0; i < loops; ++i) {
30 for (let j = 0; j < numChildOfHost; ++j) {
31 let div1 = document.createElement('div');
32 div1.setAttribute('slot', 'slot1');
33 host.appendChild(div1);
34 let div2 = document.createElement('div');
35 div2.setAttribute('slot', 'slot2');
36 host.appendChild(div2);
37 }
38 host.innerHTML = '';
39 }
40 }
41
42 PerfTestRunner.measureRunsPerSecond({
43 description: "Measure v1 distribution performance",
44 run: run,
45 done: () => {
46 wrapper.innerHTML = '';
47 }
48 });
49 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698