0

Workaround for Blink A11y perf test timeouts creating misleading results

Cut the amount of work performed in each perf test.
Once this lands, every Blink a11y performance measurement will appear
to show an approximate improvement of 67% (2/3).

This should fix the issue where performance regressions led to test timeouts, which in turn led to the appearance of a perf improvement,
or where fixing a perf bug made gave the appearance of
a perf regression.

Bug: 1340360
Change-Id: I9dd1946e6c8a17adb81c404ff34c9ff58063533c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3735149
Reviewed-by: Mark Schillaci <mschillaci@google.com>
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1020612}
This commit is contained in:
Aaron Leventhal
2022-07-04 16:43:00 +00:00
committed by Chromium LUCI CQ
parent 3f8c0616a4
commit 7aaeb067b8
19 changed files with 23 additions and 23 deletions

@@ -29,11 +29,11 @@ function runTest() {
}
setTimeout(() => {
// Add 100 cells to each row.
// Add 33 cells to each row.
for (let row = table.firstElementChild;
row;
row = row.nextElementSibling) {
for (let i = 0; i < 100; i++) {
for (let i = 0; i < 33; i++) {
let cell = document.createElement('td');
cell.innerHTML = i;
row.appendChild(cell);

@@ -47,7 +47,7 @@ function runTest() {
// Iterate over some of the links and focus each one with a different
// delay. Just focusing a link shouldn't incur a large cost,
// even if the page has a lot of elements.
for (let i = 0; i < 100; i++) {
for (let i = 0; i < 33; i++) {
window.setTimeout(() => {
document.getElementById('link' + i).focus();
}, 10 * i);

@@ -48,7 +48,7 @@ function runTest() {
function insertDivChildAfterManySpanChildren() {
testColor(getComputedStyle(container).color, red, 'Initial color');
for (let i = 0; i < 2500; ++i)
for (let i = 0; i < 833; ++i)
container.appendChild(document.createElement("span"));
container.appendChild(document.createElement("div"));
container.classList.add('a');
@@ -76,4 +76,4 @@ PerfTestRunner.startMeasureValuesAsync({
</script>
</html>
</html>

@@ -26,7 +26,7 @@ function runTest() {
// in-between.
var testElement = document.getElementById('testElement');
var html = '';
for (var i = 0; i < 1000; i++) {
for (var i = 0; i < 333; i++) {
html += randomString() + ' ' + randomString() + '<br>';
}
testElement.innerHTML = html;

@@ -71,7 +71,7 @@ function generateAllContent() {
root2.id = 'root2';
root2.className = 'root';
for (let i = 0; i < 50; i++) {
for (let i = 0; i < 17; i++) {
const child1 = generateNodes(100, "blue");
root1.appendChild(child1);
const child2 = generateNodes(100, "green");

@@ -61,7 +61,7 @@ function generateAllContent() {
root2.id = 'root2';
root2.className = 'root';
for (let i = 0; i < 50; i++) {
for (let i = 0; i < 17; i++) {
const child1 = generateNodes(100, "blue");
root1.appendChild(child1);
const child2 = generateNodes(100, "green");

@@ -63,7 +63,7 @@ function generateAllContent() {
root2.id = 'root2';
root2.className = 'root';
for (let i = 0; i < 900; i++) {
for (let i = 0; i < 300; i++) {
const child1 = generateNodes(12, "blue");
root1.appendChild(child1);
const child2 = generateNodes(12, "green");

@@ -61,7 +61,7 @@ function generateAllContent() {
root2.id = 'root2';
root2.className = 'root';
for (let i = 0; i < 900; i++) {
for (let i = 0; i < 300; i++) {
const child1 = generateNodes(12, "blue");
root1.appendChild(child1);
const child2 = generateNodes(12, "green");

@@ -24,7 +24,7 @@ function runTest() {
startTime = PerfTestRunner.now();
document.body.innerHTML = '';
appendManyElements(document.body, 7);
appendManyElements(document.body, 6);
setTimeout(changeLeafText, 10);

@@ -24,7 +24,7 @@ function runTest() {
startTime = PerfTestRunner.now();
document.body.innerHTML = '';
appendManyElements(document.body, 7);
appendManyElements(document.body, 6);
setTimeout(changeLeafText, 10);

@@ -24,7 +24,7 @@ function runTest() {
startTime = PerfTestRunner.now();
document.body.innerHTML = '';
appendManyElements(document.body, 7);
appendManyElements(document.body, 6);
setTimeout(changeLeafText, 10);

@@ -24,7 +24,7 @@ function runTest() {
startTime = PerfTestRunner.now();
document.body.innerHTML = '';
appendManyElements(document.body, 7); // Create tree 7 levels deep.
appendManyElements(document.body, 6); // Create tree 6 levels deep.
setTimeout(changeLeafText, 10);

@@ -7,9 +7,9 @@
<sn-form slot="form-slot"></sn-form>
</sn-show-element>
<script>
const TABLE_COLS = 15;
const TABLE_ROWS = 15;
const FORM_CONTROLS = 15;
const TABLE_COLS = 5;
const TABLE_ROWS = 5;
const FORM_CONTROLS = 5;
class snShowElement extends HTMLElement {
constructor() {

@@ -27,7 +27,7 @@ function runTest() {
startTime = PerfTestRunner.now();
document.body.innerHTML = '';
appendManyElements(document.body, 7);
appendManyElements(document.body, 6);
setTimeout(changeLeafText, 250);

@@ -24,7 +24,7 @@ function runTest() {
startTime = PerfTestRunner.now();
document.body.innerHTML = '';
appendManyElements(document.body, 7);
appendManyElements(document.body, 6);
setTimeout(changeLeafText, 250);

@@ -20,7 +20,7 @@ function runTest() {
// Fill the textarea with 1000 lines of random numbers.
var testElement = document.getElementById('testElement');
testElement.textContent = new Array(1000).fill(0).map(
testElement.textContent = new Array(333).fill(0).map(
(_, i) => Math.floor(100*Math.random())).join('\n');
// Wait to allow the asynchronous accessibility code that's

@@ -61,7 +61,7 @@ function generateAllContent() {
root2.id = 'root2';
root2.className = 'root';
for (let i = 0; i < 300; i++) {
for (let i = 0; i < 100; i++) {
const child1 = generateNodes(20, "blue");
root1.appendChild(child1);
const child2 = generateNodes(20, "green");

@@ -63,7 +63,7 @@ function generateAllContent() {
root2.id = 'root2';
root2.className = 'root';
for (let i = 0; i < 300; i++) {
for (let i = 0; i < 100; i++) {
const child1 = generateNodes(20, "blue");
root1.appendChild(child1);
const child2 = generateNodes(20, "green");

@@ -61,7 +61,7 @@ function generateAllContent() {
root2.id = 'root2';
root2.className = 'root';
for (let i = 0; i < 30; i++) {
for (let i = 0; i < 10; i++) {
const child1 = generateNodes(5, "blue");
root1.appendChild(child1);
const child2 = generateNodes(5, "green");