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

Side by Side Diff: third_party/WebKit/PerformanceTests/DOM/long-sibling-list.html

Issue 2491203002: Backport the long-sibling-list perf test to reference build DOM APIs. (Closed)
Patch Set: Iterate fewer times to avoid timeouts on mobile devices. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | tools/perf/benchmarks/blink_perf.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/runner.js"></script> 2 <script src="../resources/runner.js"></script>
3 <div id="container"></div> 3 <div id="container"></div>
4 <script> 4 <script>
5 'use strict'; 5 'use strict';
6 6
7 PerfTestRunner.measureRunsPerSecond({ 7 PerfTestRunner.measureRunsPerSecond({
8 description: 'Adds, then lays out, a long list of sibling elements ' + 8 description: 'Adds, then lays out, a long list of sibling elements ' +
9 'separated by spaces', 9 'separated by spaces',
10 setup: () => { 10 setup: () => {
11 container.parentNode.replaceChild(container.cloneNode(false), container); 11 container.parentNode.replaceChild(container.cloneNode(false), container);
12 PerfTestRunner.gc(); 12 PerfTestRunner.gc();
13 }, 13 },
14 run: () => { 14 run: () => {
15 const num_words = 1000; 15 const num_words = 300;
16 for (let i = 0; i < num_words; i++) { 16 for (var i = 0; i < num_words; i++) {
17 let a = document.createElement('a'); 17 var a = document.createElement('a');
18 a.append(i); 18 a.appendChild(document.createTextNode('' + i));
19 container.append(a); 19 container.appendChild(a);
20 container.append(' '); 20 container.appendChild(document.createTextNode(' '));
21 } 21 }
22 PerfTestRunner.forceLayout(); 22 PerfTestRunner.forceLayout();
23 } 23 }
24 }); 24 });
25 </script> 25 </script>
OLDNEW
« no previous file with comments | « no previous file | tools/perf/benchmarks/blink_perf.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698