Skip to content

superseded: Campaigns query reuse (replacement #19007) - #19006

Closed
pelikhan wants to merge 1 commit into
mainfrom
pelikhan-campaigns-page-performance
Closed

pelikhan wants to merge 1 commit into
mainfrom
pelikhan-campaigns-page-performance

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Superseded — do not merge

Replacement: #19007. Following the user-directed review of overlapping optimizations, Campaigns will use the same abort-scoped query-binding: page subscription and request-local compiler dependency-DAG sharing as Repository overview. The separate flush-local cache / createSubscriptionQueryReuse implementation in this PR must not land alongside that mechanism.

The Campaigns contract fixture, production-boundary payload/provenance/context/refresh regressions, and paired measurement methodology have been handed directly to the #19007 owner. This PR remains draft and open until the replacement's Campaigns coverage and behavior/performance are confirmed; it must not be merged independently. The competing implementation is still present on this historical branch, so consolidation is not yet claimed complete.

Original measurements, screenshots, and the description below are preserved as historical evidence for this implementation, not as measurements of the replacement.


Summary

Remove the Campaigns page's repeated evaluation of the same campaign-inventory dependency graph. The dispatch chart, coverage chart, and inventory table retain their existing declarative contracts, including import-evidence quality, horizon and filters, ordering, links, and partial inventory preview.

Narrowing the charts' source would drop evidence-quality dependencies and alter filter behavior. Instead, the canonical browser worker reuses only its last compact, identical compiled view result within one subscription flush. Query identifiers are normalized for comparison; canonical source identities, literal values, executable clauses, and resolved scope remain exact. Each view retains its own metadata, pagination, abort-scoped subscription, and reactive updates. Reuse expires after the flush or a canonical revision change and is limited to one result of 1,000 rows / 1 MiB. Hosted/GitHub-backed requests, partial previews, unavailable results, and invalid graphs are excluded.

No other page or campaign-detail/tab query contracts are changed.

Measured result

Three alternating before/after pairs used fresh Chromium processes, the same pinned deployed manifest, and the same fully ingested 575,582 canonical records: 4,073 runs, 695 workflows, 6 repositories, and 11 campaigns. All three inventory subscriptions and page chrome had to settle; ingestion, the quiet-period wait, and subsequent Table interaction are excluded from default readiness.

Pair Before After Reduction
1: before → after 27.591 s 9.681 s 64.9%
2: after → before 29.699 s 9.768 s 67.1%
3: before → after 30.624 s 9.935 s 67.6%
Median 29.699 s 9.768 s 67.1% / 3.04× faster

Median Table-switch readiness fell from 30.144 s to 9.590 s. All three complete view payloads, including rows and source-quality metadata, were deeply identical across all six measurements. Each optimized refresh performed one full inventory evaluation and reused it for the other two views.

The machine was shared with other optimization sessions (one-minute load averages roughly 21–31), so these absolute times should not be compared directly with the earlier deployed 17.08 s observation. Paired measurements, reversed ordering, exact payload equality, and the three-to-one evaluation regression assertion establish the improvement despite contention. Fresh browser processes avoid Chromium reusing the previous variant's worker script. Service workers were blocked consistently; their existing asset-update console warning occurred in both variants, with no visible Campaigns errors.

Pinned manifest SHA-256: cce19a1f7237786b47a363678ea51e6a685e93a2eca21dd1bd80aac82b605808. Deployed evidence revision: 3afa28aea1b381123effea45bc49bc4692356ef7; paired application baseline: 2de03249512f65fc0eb7ca2a438eac647205f2e2.

Verification

  • Full dashboard unit suite: 372 files passed, 3,603 tests passed, one skipped; final focused worker/query regression run: 28 passed.
  • Production worker regressions verify single evaluation, exact per-view payloads and metadata, canonical refresh updates, distinct filter isolation, horizon scoping, independent pagination, and stale/partial evidence from all four retained event sources.
  • Identity/bounds tests reject invalid graphs, failures, native metadata and oversized results, and distinguish canonical sources, literal values, search, ordering and horizon.
  • Dashboard lint, typecheck, document validation, and build passed.
  • Chromium horizon/navigation interactions passed at desktop, 390 px and 320 px.
  • Deployed-data Overview worker-memory budget passed.
  • Workflow compile passed: 71 workflows.

Desktop and mobile screenshots of the fully populated optimized Campaigns page are attached in a PR comment. Raw paired measurements, the measurement script, pinned inputs and screenshots remain session artifacts; no screenshots or downloaded data are committed.

Share the last bounded complete compiled view result within one canonical worker subscription flush, preserving source quality, scope, pagination, and reactive lifetimes. Add production-boundary Campaigns regressions and document the reuse limits.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

Populated Campaigns page after query reuse: desktop (1440 x 1000) and mobile (390 x 844). Captured only after all three inventory view subscriptions and page chrome completed against the full 575,582-record deployed dataset.

Populated Campaigns page at desktop width

Populated Campaigns page at mobile width

@github-actions

Copy link
Copy Markdown
Contributor
Dashboard dead views

Dead element views (0):
Dead dashboard pages (0):
Analyzed 8 element renderers and 66 dashboard pages across 1 dashboard.json file(s) from dashboard/site/src/components/ui-elements.js.

⚠️ This reachability report is informational and does not block the pull request.
🔎 View the workflow run and report artifact.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Supplementary Lighthouse smoke passed all 12 CFO/CTO/CSO scenarios across empty/full data and desktop/mobile: performance scores 97–100. Command: DASHBOARD_PERFORMANCE_REPEATS=1 DASHBOARD_PERFORMANCE_NETWORK_MODES=cold npm --prefix dashboard/site run test:performance. The initial attempt ended during a remote data download (HTTP/2 fetch terminated); the retry completed successfully. The paired Campaigns timings above remain the primary performance evidence.

@pelikhan pelikhan changed the title perf(dashboard): reuse identical Campaigns view queries per refresh superseded: Campaigns query reuse (replacement #19007) Oct 19, 2026
@pelikhan

Copy link
Copy Markdown
Collaborator Author

Closed at the user’s request because this separate worker-cache implementation is superseded by #19007. Campaigns will use the shared declarative page binding and compiler dependency sharing there. Existing benchmark evidence and review history are retained; the source branch is not being deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant