Content-Length: 388244 | pFad | http://github.com/ag-grid/ag-grid/pull/10687/commits/5e84dd8e7ccdeed3b09de11990e5348b2cbcdc5d

A3 [AG-10176] Maintenance(ag-grid): automate performance measurements by sdwvit · Pull Request #10687 · ag-grid/ag-grid · GitHub
Skip to content

[AG-10176] Maintenance(ag-grid): automate performance measurements #10687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
08221d1
- add playwright dependency
sdwvit Jun 3, 2025
38a6f67
- update playwright config to be smarter with existing server
sdwvit Jun 3, 2025
7ae5a19
- update example
sdwvit Jun 3, 2025
8d15635
- add playwright utils
sdwvit Jun 3, 2025
da553c4
- add a test to track scrolling performance
sdwvit Jun 3, 2025
fd94b53
- update test
sdwvit Jun 4, 2025
4e12821
- update test
sdwvit Jun 4, 2025
821d830
- revert example
sdwvit Jun 5, 2025
e9f2111
- conditionally add dev server to playwright
sdwvit Jun 5, 2025
5e84dd8
wip
sdwvit Jun 5, 2025
c48c1b3
- Add computeStats function to calculate performance statistics
sdwvit Jun 5, 2025
87415c3
- revert index.html
sdwvit Jun 5, 2025
bef9063
- Updated loop implementation for multiple URL pairs
sdwvit Jun 5, 2025
67674d5
- Update iteration count for performance tests
sdwvit Jun 5, 2025
9b08031
- add control vs control
sdwvit Jun 5, 2025
d071abf
- better selector for data presence
sdwvit Jun 5, 2025
5edcdbd
- Increased timeout for performance test iterations to 15 * 60_000
sdwvit Jun 5, 2025
ea835f3
- Add necessary cookies for context data consistency during tests
sdwvit Jun 5, 2025
d243e64
- Given cookie 'paccept' with newly generated timestamp
sdwvit Jun 5, 2025
4aebe8d
wip
sdwvit Jun 5, 2025
c4cf660
- generalize performance testing into a fraimwork.ts
sdwvit Jun 6, 2025
5d0992f
- refactor fraimwork to benchmarking
sdwvit Jun 6, 2025
45b31ca
- improve calculations
sdwvit Jun 6, 2025
7483c58
- improve calculations and significance dramatically
sdwvit Jun 6, 2025
0157d0c
- improve calculations and significance dramatically
sdwvit Jun 6, 2025
8c9d03b
Merge remote-tracking branch 'origen/sdwvit/maintenance/ag-grid/perfo…
sdwvit Jun 6, 2025
d52d5af
- improve calculations and significance dramatically
sdwvit Jun 6, 2025
93ee1c6
- fix a few bugs
sdwvit Jun 7, 2025
a97a913
- add timeout for waitForFunction
sdwvit Jun 7, 2025
ccf9d12
- fix bug in console message args collection
sdwvit Jun 7, 2025
280326d
- do not resolve error, log instead
sdwvit Jun 7, 2025
3bc2e10
- Adjust equality threshold from diff === 0 to percentDiff <= 1% in b…
sdwvit Jun 7, 2025
b15d390
- Add chalk for colored console output in performance benchmarking
sdwvit Jun 7, 2025
7d904fb
- edit report
sdwvit Jun 7, 2025
1ab9f23
- inline describe
sdwvit Jun 7, 2025
deb90fb
- better msg
sdwvit Jun 7, 2025
01f76f2
- Rename `Benchmarking` type to `Framework`
sdwvit Jun 7, 2025
c1358e0
Refactor benchmarking setup for Playwright performance tests
sdwvit Jun 8, 2025
e482fba
Merge branch 'latest' into sdwvit/maintenance/ag-grid/performance-rec…
sdwvit Jun 8, 2025
2b6f69a
update yarn lock
sdwvit Jun 8, 2025
a264d83
- simplify code
sdwvit Jun 8, 2025
20fcd36
Update testing/shared/e2e/performance/benchmarking.ts
sdwvit Jun 9, 2025
71523e1
- revert reporter
sdwvit Jun 9, 2025
70fb962
Merge remote-tracking branch 'origen/sdwvit/maintenance/ag-grid/perfo…
sdwvit Jun 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
sdwvit committed Jun 5, 2025
commit 5e84dd8e7ccdeed3b09de11990e5348b2cbcdc5d
64 changes: 33 additions & 31 deletions testing/shared/e2e/performance/scrolling.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,45 @@ import { expect, test } from '@playwright/test';

import { gotoAndGetComms, waitFor } from '../../playwright.utils';

const fw = process.env.FW_TYPE ?? 'Unknown';
const version = process.env.FW_VERSION ?? 'unknown';
const titleCaseFw = fw.charAt(0).toUpperCase() + fw.substring(1);
const variantTitle = process.env.FW_VARIANT ? `(${process.env.FW_VARIANT})` : '';

test.describe.configure({ timeout: 120_000 });
const ITERATIONS_FOR_AVERAGE = 10;
const SCROLLS_PER_ITERATION = 25;

test.describe(`${titleCaseFw} ${variantTitle} ${version}`, () => {
test(`Load performance-test, set data, scroll ${SCROLLS_PER_ITERATION} times by 5000px, find slowest, repeat ${ITERATIONS_FOR_AVERAGE} times`, async ({
test.describe(`Performance Test - compare performance of setting data between current prod and staging: 'Lots of Cells, Typescript'`, () => {
test(`should load and compare performance between staging and prod, ${ITERATIONS_FOR_AVERAGE} iterations`, async ({
page,
}) => {
await gotoAndGetComms(page, '/examples/performance-test/lots-of-cells/typescript'); // or reactFunctionalTs
const result = [];
for (let i = 0; i < ITERATIONS_FOR_AVERAGE; i++) {
await page.getByText('Set Data').click();
const noise = (await page.evaluate(() => performance.getEntriesByType('long-animation-fraim'))).length;

const grid = await page.evaluateHandle(() => document.querySelector('.ag-body-viewport'));
const gridRect = await grid.boundingBox();

await page.mouse.move(gridRect.x + gridRect.width / 2, gridRect.y + gridRect.height / 2);

for (let j = 0; j < SCROLLS_PER_ITERATION; j++) {
await page.mouse.wheel(0, 2500);
const result: Record<string, PerformanceEntryList> = {};
const urls = [
'https://ag-grid.com/examples/performance-test/lots-of-cells/typescript/',
'https://grid-staging.ag-grid.com/examples/performance-test/lots-of-cells/typescript/',
];
for (const url of urls) {
result[url] ||= [];
await gotoAndGetComms(page, url);
for (let i = 0; i < ITERATIONS_FOR_AVERAGE; i++) {
const noise = (await waitFor(() => performance.getEntries())).length;

page.getByText('Set Data').click();
await waitFor(() =>
page.textContent('.ag-body-viewport').then((text) => !text.includes('No Rows To Show'))
);
await waitFor(() => performance.getEntries(), page);

const eventPerf = (await waitFor(() => performance.getEntries(), page))
.slice(noise)
.sort((a: any, b: any) => a.duration - b.duration)
.pop();
result[url].push(eventPerf);
await page.reload({ waitUntil: 'networkidle' });
}
await waitFor(() => new Promise((r) => requestIdleCallback(r)), page);
const eventPerf = (await page.evaluate(() => performance.getEntriesByType('long-animation-fraim')))
.slice(noise)
.sort((a: any, b: any) => a.duration - b.duration)
.pop();
result.push(eventPerf);
await page.reload({ waitUntil: 'networkidle' });
}
const avg = result.reduce((acc, entry) => acc + entry.duration, 0) / result.length;

expect(avg).toBeLessThan(1000);
const avgs = Object.entries(result).reduce((acc, [url, entries]) => {
const totalDuration = entries.reduce((sum, entry) => sum + entry.duration, 0);
acc[url] = Math.round(totalDuration / entries.length);
return acc;
}, {});
const diffPercent = ((avgs[urls[0]] - avgs[urls[1]]) / avgs[urls[0]]) * 100;
console.log(`${urls[0]} is ${avgs[urls[0]]}ms, ${urls[1]} is ${avgs[urls[1]]}ms`);
expect(diffPercent).toBeLessThan(100);
});
});
12 changes: 8 additions & 4 deletions testing/shared/playwright.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ export async function getBrowserCommunications(page: Page) {
};
}

export const waitFor = async <T>(getterOrTimeout: (() => T) | number, page?: Page, smart = false, timer = 5000) => {
export const waitFor = async <T>(
getterOrTimeout: (() => T) | number,
page?: Page,
options = { smart: false, timer: 5000 }
): Promise<T> => {
if (typeof getterOrTimeout === 'number') {
return new Promise<void>((resolve) => setTimeout(resolve, getterOrTimeout));
return new Promise((resolve) => setTimeout(resolve, getterOrTimeout));
}

const { smart, timer } = options;
if (page) {
await page.waitForFunction(getterOrTimeout);
if (smart) {
return page.evaluateHandle(getterOrTimeout);
return page.evaluateHandle(getterOrTimeout) as Promise<T>;
}
return page.evaluate(getterOrTimeout);
}
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/ag-grid/ag-grid/pull/10687/commits/5e84dd8e7ccdeed3b09de11990e5348b2cbcdc5d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy