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

Side by Side Diff: third_party/WebKit/PerformanceTests/Paint/large-table-repaint.html

Issue 2883603002: Use the new tracing based measurement for blink_perf.paint (Closed)
Patch Set: - Created 3 years, 7 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <body> 2 <body>
3 <script src="../resources/runner.js"></script> 3 <script src="../resources/runner.js"></script>
4 <script src="resources/paint.js"></script>
4 <style>td { border: 1px solid blue }</style> 5 <style>td { border: 1px solid blue }</style>
5 <script> 6 <script>
6 function createTable(rows, columns) { 7 function createTable(rows, columns) {
7 var table = document.createElement("TABLE"); 8 var table = document.createElement("TABLE");
8 // Collapsing border is not necessary to see the slowness 9 // Collapsing border is not necessary to see the slowness
9 // but it makes the painting phase ~2x slower. 10 // but it makes the painting phase ~2x slower.
10 table.style.borderCollapse = "collapse"; 11 table.style.borderCollapse = "collapse";
11 for (var i = 0; i < rows; ++i) { 12 for (var i = 0; i < rows; ++i) {
12 var tr = document.createElement("TR"); 13 var tr = document.createElement("TR");
13 for (var j = 0; j < columns; ++j) { 14 for (var j = 0; j < columns; ++j) {
14 var td = document.createElement("TD"); 15 var td = document.createElement("TD");
15 tr.appendChild(td); 16 tr.appendChild(td);
16 } 17 }
17 table.appendChild(tr); 18 table.appendChild(tr);
18 } 19 }
19 return table; 20 return table;
20 } 21 }
21 22
22 var table = createTable(300, 320); 23 var table = createTable(300, 320);
23 table.style.border = '2px solid green'; 24 table.style.border = '2px solid green';
24 document.body.appendChild(table); 25 document.body.appendChild(table);
25 26
26 PerfTestRunner.measureFrameTime({ 27 measurePaint({
27 run: function() { 28 run: function() {
28 table.style.borderColor = table.style.borderColor == 'green' ? 29 table.style.borderColor = table.style.borderColor == 'green' ?
29 'yellow' : 'green'; 30 'yellow' : 'green';
30 }, 31 },
31 }); 32 });
32 </script> 33 </script>
33 </body> 34 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698