diff --git a/perf/budgets.json b/perf/budgets.json index d42ef7103..0c2d610cd 100644 --- a/perf/budgets.json +++ b/perf/budgets.json @@ -46,7 +46,7 @@ "consoleOutput.keyMissedFramePct": 10, "consoleOutput.tbtMs": 50, - "gitLog.showMs": 150, + "gitLog.showMs": 300, "gitLog.droppedFramesPct": 2, "gitLog.tbtMs": 50, "gitLog.arrowKeyP95Ms": 20, diff --git a/perf/scenarios.ts b/perf/scenarios.ts index 9feba524f..9c194595a 100644 --- a/perf/scenarios.ts +++ b/perf/scenarios.ts @@ -269,15 +269,18 @@ const scroll: Scenario = { /** * Git Log with 20,000 commits on branching lanes, loaded page by page as the - * backend does: showing it, walking the selection with the arrow keys (the - * details pane follows) and wheel-scrolling through it. + * backend does (150 ms a page, like `git log`): showing it, walking the + * selection with the arrow keys (the details pane follows) and wheel-scrolling + * through several pages. */ const gitLog: Scenario = { id: "gitLog", title: "Show, navigate and scroll a 20k-commit Git Log", async run(h) { await h.page.evaluate(() => - (window as never as { __openideaPerf: { fakeGitLog(n: number): void } }).__openideaPerf.fakeGitLog(20_000), + ( + window as never as { __openideaPerf: { fakeGitLog(n: number, latencyMs?: number): void } } + ).__openideaPerf.fakeGitLog(20_000, 150), ); const showMs = await h.measure( () => @@ -297,8 +300,9 @@ const gitLog: Scenario = { await h.page.mouse.move(box.x + box.width / 2, box.y + box.height / 2); const t0 = await h.now(); await h.inPage((p) => p.startFrames()); - for (let i = 0; i < 120; i++) { - await h.page.mouse.wheel(0, i < 80 ? 400 : -400); + // Far enough to load several more pages on the way. + for (let i = 0; i < 160; i++) { + await h.page.mouse.wheel(0, i < 120 ? 600 : -600); await h.page.waitForTimeout(16); } await h.page.waitForTimeout(200); diff --git a/src/workbench/perfProbe.ts b/src/workbench/perfProbe.ts index 1893d064e..f53a42f75 100644 --- a/src/workbench/perfProbe.ts +++ b/src/workbench/perfProbe.ts @@ -32,9 +32,10 @@ export interface PerfProbe { fakeCompletion(items: number): void; /** * Answers the Git Log with `commits` generated commits (a main line with - * feature branches merging into it), paged like the backend. `0` removes it. + * feature branches merging into it), paged like the backend, each page after + * `latencyMs` (a `git log` call). `0` commits removes it. */ - fakeGitLog(commits: number): void; + fakeGitLog(commits: number, latencyMs?: number): void; } const KINDS: CompletionKind[] = [ @@ -159,7 +160,7 @@ export function installPerfProbe(): () => void { : null, ); }, - fakeGitLog(count) { + fakeGitLog(count, latencyMs = 0) { const commits = Array.from({ length: count }, (_, i) => commit(i, count)); setRoute( "gitLog", @@ -169,7 +170,8 @@ export function installPerfProbe(): () => void { const { skip, limit, range } = (args as { query: LogQuery }).query; // Outgoing commits (`@{u}..HEAD`) and the like: none. if (range) return Promise.resolve([]); - return Promise.resolve(commits.slice(skip, limit ? skip + limit : undefined)); + const page = commits.slice(skip, limit ? skip + limit : undefined); + return new Promise((resolve) => setTimeout(() => resolve(page), latencyMs)); } : null, );