Skip to content

Commit

Permalink
Combine 10 table and selection paint perf tests into 3
Browse files Browse the repository at this point in the history
Now one perf test combines several change types. We don't actually care
about relative small performance changes for each change type, but care
more about larger overall changes.

BTW add an OWNERS file containing pdr, schenney and wangxianzhu
for perf_tests/paint.

Change-Id: I3e88b7c2e6f304dfa80a28b2847704850079b536
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2380497
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802822}
  • Loading branch information
wangxianzhu authored and Commit Bot committed Aug 28, 2020
1 parent 8d259ac commit e2cdb1a
Show file tree
Hide file tree
Showing 12 changed files with 134 additions and 396 deletions.
3 changes: 3 additions & 0 deletions third_party/blink/perf_tests/paint/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pdr@chromium.org
schenney@chromium.org
wangxianzhu@chromium.org

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<body>
<script src="../resources/runner.js"></script>
<script src="resources/paint.js"></script>
<style>
table {
border-collapse: collapse;
will-change: transform;
}
table.zero-width-border td {
border: 0px solid blue;
}
table.visible-border td {
border: 1px solid blue;
}
</style>
<script>
function createTable(rows, columns) {
var table = document.createElement("TABLE");
for (var i = 0; i < rows; ++i) {
var tr = document.createElement("TR");
for (var j = 0; j < columns; ++j) {
var td = document.createElement("TD");
tr.appendChild(td);
}
table.appendChild(tr);
}
return table;
}

var table1 = createTable(300, 300);
table1.className = 'zero-width-border';
document.body.appendChild(table1);

var table2 = createTable(300, 300);
table2.className = 'invisible-border';
document.body.appendChild(table2);

var table3 = createTable(300, 300);
table3.className = 'visible-border';
document.body.appendChild(table3);

var count = 0;
var ix = 30;
var iy = 30;

measurePaint({
iterationCount: 30,
run: function() {
var table = [table1, table2, table3][count % 3];
table.childNodes[iy].childNodes[ix].style.backgroundColor = 'teal';
ix++;
iy++;
count++;
},
});
</script>
</body>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,66 @@
<body>
<script src="../resources/runner.js"></script>
<script src="resources/paint.js"></script>
<style>td { border: 1px solid blue }</style>
<style>
table {
border: 2px solid green;
border-collapse: collapse;
font-size: 3px;
will-change: transform;
}
td {
border: 1px solid blue;
}
table.text td::before {
content: "ABC";
}
table.background td {
background: green;
}
</style>
<script>
function createTable(rows, columns) {
var table = document.createElement("TABLE");
// Collapsing border is not necessary to see the slowness
// but it makes the painting phase ~2x slower.
table.style.borderCollapse = "collapse";
for (var i = 0; i < rows; ++i) {
var tr = document.createElement("TR");
for (var j = 0; j < columns; ++j) {
var td = document.createElement("TD");
tr.appendChild(td);
}
table.appendChild(tr);
var table = document.createElement("TABLE");
for (var i = 0; i < rows; ++i) {
var tr = document.createElement("TR");
for (var j = 0; j < columns; ++j) {
var td = document.createElement("TD");
tr.appendChild(td);
}
return table;
table.appendChild(tr);
}
return table;
}

var table = createTable(300, 320);
document.body.appendChild(table);
var table1 = createTable(100, 100);
document.body.appendChild(table1);

var table2= createTable(150, 150);
table2.className = 'text';
document.body.appendChild(table2);

var table3 = createTable(150, 150);
table3.className = 'background';
document.body.appendChild(table3);

var count = 0;
var ix = 30;
var iy = 30;

measurePaint({
run: function() {
table.childNodes[iy].childNodes[ix].style.borderColor = "red";
ix++;
iy++;
},
iterationCount: 40,
run: function() {
if (count % 4 == 0) {
table1.style.borderColor = table1.style.borderColor == 'green' ?
'yellow' : 'green';
} else {
var table = [table1, table2, table3][count % 3];
table.childNodes[iy].childNodes[ix].style.borderColor = "red";
ix++;
iy++;
}
count++;
},
});
</script>
</body>
34 changes: 0 additions & 34 deletions third_party/blink/perf_tests/paint/large-table-repaint.html

This file was deleted.

Loading

0 comments on commit e2cdb1a

Please sign in to comment.