From 32ab69855f56aa54218d88091d23f42e93c5bd37 Mon Sep 17 00:00:00 2001 From: 4gray Date: Tue, 13 Oct 2026 21:51:12 +0200 Subject: [PATCH] perf(web): ratchet the change-detection ticks that zoneless made deterministic On the canonical runner (Performance ratchet run 38359088033, three runs of this branch, five iterations each) renderer.cdTicksToFirstCard read 5, renderer.cdTicksIdle30s 3 and renderer.cdTicksToFirstPage 9 in all 15 iterations, against 31, 1 to 4 and 22 with zone.js. They become baselines with zero slack and the Performance journeys job checks them. J3 and J4 tick counts still vary by one and stay unenforced; J3 wall clock is in master's range, so the local rise measured on #1824 was machine load. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 3 +++ docs/architecture/performance-journeys.md | 8 +++++-- docs/architecture/zoneless-migration.md | 24 +++++++++++++++++--- tools/performance/journey-baselines.json | 27 +++++++++++++++++++++++ 4 files changed, 57 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5a581c80..d954da6a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -348,9 +348,12 @@ jobs: --only launch/main.modulesRegisteredBeforeWindow --only launch/renderer.layoutShiftScore --only launch/renderer.layoutShiftScoreSettled + --only launch/renderer.cdTicksToFirstCard + --only launch/renderer.cdTicksIdle30s --only open-source/main.mockHttpRequestsToSettled --only open-source/renderer.ipcCallsToFirstPage --only open-source/renderer.layoutShiftScore + --only open-source/renderer.cdTicksToFirstPage --only playback/renderer.httpRequestsToPlaying --only playback/renderer.layoutShiftScore --only search/renderer.ipcCallsPerSearch diff --git a/docs/architecture/performance-journeys.md b/docs/architecture/performance-journeys.md index 44e538282..3b5dda619 100644 --- a/docs/architecture/performance-journeys.md +++ b/docs/architecture/performance-journeys.md @@ -1424,8 +1424,12 @@ Not enforced, with the reason: - Every `renderer.longTasks` (J1 2 or 1, J2 0 with one 1 earlier in the week, J3 1 or 2 until #1817 and 0 since): a long task is a task over 50 ms, so the count follows runner speed, not work. -- Every `cdTicks` counter: the zoneless migration (plan item C6) changes - them. +- J3 `renderer.cdTicksToPlaying` (7 or 8) and J4 + `renderer.cdTicksToResults` (10 or 11): not identical even zoneless; the + player's and the search debounce's events land in one or two ticks. J1 + `renderer.cdTicksToFirstCard` (5), `renderer.cdTicksIdle30s` (3) and J2 + `renderer.cdTicksToFirstPage` (9) are enforced since the zoneless flip + (#1929), identical in all 15 iterations of its three dispatched runs. - J2 `renderer.domMutationsToFirstPage`: 1,602 or 1,603 between runs of recent commits. - J3 `renderer.ipcCallsToPlaying` (4 or 5) and diff --git a/docs/architecture/zoneless-migration.md b/docs/architecture/zoneless-migration.md index 9b7720526..4833bd5e7 100644 --- a/docs/architecture/zoneless-migration.md +++ b/docs/architecture/zoneless-migration.md @@ -305,6 +305,24 @@ Build `electron-performance` and run the journeys as described in [performance journeys](performance-journeys.md), then paste `renderer.cdTicksToFirstCard`, `renderer.cdTicksIdle30s`, `renderer.cdTicksToFirstPage` and `renderer.cdTicksToPlaying` before and -after. While zone.js is on, removing Eager does not change the number of -ticks, only the work per tick; expect the counters to stay put until the flag -PR and the template work (DOM mutations, profile time) to drop. +after. Until the flip, while zone.js was on, removing Eager did not change +the number of ticks, only the work per tick. Since the flip (#1929) +`renderer.cdTicksToFirstCard` (5), `renderer.cdTicksIdle30s` (3) and +`renderer.cdTicksToFirstPage` (9) are ratchet baselines: a change that adds a +tick to launch, to the idle dashboard or to opening a source fails the +journeys job. + +Canonical runner (`Performance ratchet` dispatched on #1929, three runs, five +iterations each) against `master` the same day with zone.js: + +| Counter | `master` (zone.js) | #1929 (zoneless) | +| --- | --- | --- | +| `renderer.cdTicksToFirstCard` | 31 (2026-10-04) | 5 | +| `renderer.cdTicksIdle30s` | 1 to 4 | 3 | +| `renderer.cdTicksToFirstPage` | 22 | 9 | +| `renderer.cdTicksToPlaying` | 15 to 17 | 7 or 8 | +| `renderer.initialBytes` | 1,596,201 | 1,545,931 | +| J3 `clickToPlayingMs` p50 | 151.6, 159.2, 185.7 | 128.0, 178.6, 189.5 | + +J3 wall clock is in the same range, so the local rise measured on the flag +PR was machine load. diff --git a/tools/performance/journey-baselines.json b/tools/performance/journey-baselines.json index b4d078293..aa7e1e128 100644 --- a/tools/performance/journey-baselines.json +++ b/tools/performance/journey-baselines.json @@ -57,6 +57,24 @@ "evidencePr": null, "evidenceRun": "https://github.com/4gray/iptvnator/actions/runs/37184230956", "measuredWith": "pnpm run perf:journeys (ubuntu-latest, xvfb), identical in all 55 measured iterations of 11 master runs, 2026-10-03 to 2026-10-04" + }, + "renderer.cdTicksToFirstCard": { + "value": 5, + "unit": "ticks", + "slack": 0, + "updatedAt": "2026-10-13", + "evidencePr": 1929, + "evidenceRun": "https://github.com/4gray/iptvnator/actions/runs/38359088033", + "measuredWith": "pnpm run perf:journeys (ubuntu-latest, xvfb), identical in all 15 measured iterations of 3 runs of #1929 (zoneless, d88d00506)" + }, + "renderer.cdTicksIdle30s": { + "value": 3, + "unit": "ticks", + "slack": 0, + "updatedAt": "2026-10-13", + "evidencePr": 1929, + "evidenceRun": "https://github.com/4gray/iptvnator/actions/runs/38359088033", + "measuredWith": "pnpm run perf:journeys (ubuntu-latest, xvfb), identical in all 15 measured iterations of 3 runs of #1929 (zoneless, d88d00506)" } }, "open-source": { @@ -89,6 +107,15 @@ "evidencePr": null, "evidenceRun": "https://github.com/4gray/iptvnator/actions/runs/38147072417", "measuredWith": "pnpm run perf:journeys (ubuntu-latest, xvfb), 0 with no shift recorded in all 5 measured iterations of PR #1895 (d2cb9445d), which slides the content frame and header controls instead of jumping (was 0.233)" + }, + "renderer.cdTicksToFirstPage": { + "value": 9, + "unit": "ticks", + "slack": 0, + "updatedAt": "2026-10-13", + "evidencePr": 1929, + "evidenceRun": "https://github.com/4gray/iptvnator/actions/runs/38359088033", + "measuredWith": "pnpm run perf:journeys (ubuntu-latest, xvfb), identical in all 15 measured iterations of 3 runs of #1929 (zoneless, d88d00506)" } }, "playback": {