OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/runner.js"></script> | 2 <script src="../resources/runner.js"></script> |
3 <div id="wrapper"> | 3 <div id="wrapper"> |
4 <div id="host"></div> | 4 <div id="host"></div> |
5 </div> | 5 </div> |
6 <script> | 6 <script> |
7 'use strict'; | 7 'use strict'; |
8 const numChildOfHost = 10; | 8 const numChildOfHost = 10; |
9 const numDivsInShadow = 100; | 9 const numDivsInShadow = 100; |
10 const loops = 20; | 10 const loops = 20; |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 for (let i = 0; i < numDivsInShadow; ++i) { | 22 for (let i = 0; i < numDivsInShadow; ++i) { |
23 let div = document.createElement('div'); | 23 let div = document.createElement('div'); |
24 shadowRoot.appendChild(div); | 24 shadowRoot.appendChild(div); |
25 } | 25 } |
26 | 26 |
27 function run() { | 27 function run() { |
28 let div = document.createElement('div'); | 28 let div = document.createElement('div'); |
29 for (let i = 0; i < loops; ++i) { | 29 for (let i = 0; i < loops; ++i) { |
30 host.appendChild(div); | 30 host.appendChild(div); |
31 slot.getDistributedNodes();; | 31 slot.getAssignedNodes({flatten: true}); |
32 host.removeChild(div); | 32 host.removeChild(div); |
33 slot.getDistributedNodes();; | 33 slot.getAssignedNodes({flatten: true}); |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 PerfTestRunner.measureRunsPerSecond({ | 37 PerfTestRunner.measureRunsPerSecond({ |
38 description: "Measure v1 distribution performance", | 38 description: "Measure v1 distribution performance", |
39 run: run, | 39 run: run, |
40 done: () => { | 40 done: () => { |
41 wrapper.innerHTML = ''; | 41 wrapper.innerHTML = ''; |
42 } | 42 } |
43 }); | 43 }); |
44 </script> | 44 </script> |
OLD | NEW |