Skip to content

perf(dashboard): bound Domain runs payloads and seek exact index keys - #19005

Closed
pelikhan wants to merge 1 commit into
mainfrom
pelikhan-domain-runs-performance
Closed

pelikhan wants to merge 1 commit into
mainfrom
pelikhan-domain-runs-performance

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

Optimize only domain-runs and its necessary canonical worker/index path; no main-thread filtering, schema migration, cross-request cache, or changes to the other selected pages.

  • Declare domain-run-records so the existing view compiler returns only its scoped, paginated alias, not the unbounded domains collection as well.
  • Seek an encoded tuple for unchanged single-field string equality only after verifying complete index coverage and excluding non-string tuples with a bounded probe. Computed, nullable, coercible, structured, incomplete-index, and unsupported-index cases retain the ordinary path. Budgets and request-local reads remain unchanged.
  • Preserve observation shape, exact domain scope, ordering, filtering/search, counts, provenance, run attempts/links, pagination, and abort-scoped database-change refresh. Update the fixture, generated agent catalog, specification, and focused regressions.

Paired real-data measurements

Route: #page-domain-runs?domain=www.google.com.

Original deployed revision: 3afa28aea1b381123effea45bc49bc4692356ef7; reported default readiness 9.317 s. Before editing, reproduced the same bad output: 388,774 broad canonical reads and 384,701 raw domain rows beside a 25-row payload. Initial local reproduction was 14.511 s. The original optional Table-click timeout is not page latency.

Compared unmodified checkout 2de03249512f65fc0eb7ca2a438eac647205f2e2 against this branch on identical pinned, hash-verified deployed input. Manifest SHA-256: cce19a1f7237786b47a363678ea51e6a685e93a2eca21dd1bd80aac82b605808. Every sample fully ingested 575,582 records, including 4,073 runs and 384,701 domains. Chromium 1440x1000, no deliberate throttling, unchanged persisted database, full document reload between variants, navigate from Maintenance, wait for page render and every started worker request to actually finish; exclude the 400 ms quiet-period wait.

Interleaved pairs: after/before, before/after, after/before. Other sessions shared the machine: compare local paired samples, not local-after directly against the original 9.317 s observation.

Metric Before median After median Reduction
Default page readiness 15.127 s 5.122 s 66.1%
Header worker query 4.622 s 2.402 s 48.0%
Related runs worker query 9.443 s 2.363 s 75.0%
Table response 384,701 raw rows + 25 view rows 25 view rows only No redundant collection

Readiness samples (seconds): before [15.738, 15.127, 13.980]; after [5.794, 4.973, 5.122]. All six samples preserve identical ordered 25-row observations, evidence/run links, and 5,574 total matching records. Scoped native reads still read matching observations and runs; zero fallback database reads in the metrics does not mean zero total storage work.

Validation

Passed:

  • Focused Domain runs/output-shape, coercion/null/structured-key and incomplete-index fallback, pagination, declaration contracts, and ordinary SQLite fallback tests.
  • Browser canonical-data and semantic-prompt suites: 36 passed, including real worker subscription refresh after new evidence.
  • Dashboard lint, dashboard-document validation, strict typecheck, whitespace/file-size checks, and all 36 agent catalog/CLI tests.
  • Deployed-data Overview worker-memory budget test and workflow compilation (71 workflows).

Broader validation limitations:

  • Full unit runs covered the other suites successfully; the two stale expectations introduced by the declaration/unsupported SQLite test were corrected and their focused suites pass. A final full rerun was stopped after existing large audit-curation fixture/setup tests timed out under severe shared-machine contention; not represented as an all-green final full-suite result.
  • Full browser run: 291 passed, 1 skipped, 2 failed. Core-size threshold already fails at baseline (78,039 bytes including newline versus 76,500; this adds 33 bytes). The mobile pie-chart CLS check passed on isolated rerun. No unrelated thresholds changed.
  • Lighthouse completed twelve empty-data desktop/mobile cold/PWA combinations (performance 98-100), then the browser session closed with a protocol error during the remaining data-backed scenarios. The completed paired Domain runs measurements above are the evidence for this fix.

Populated full-site desktop and mobile screenshots will be attached in a PR comment; no screenshot files are committed.

Declare the Domain runs table query so the worker returns only its paginated alias. Safely seek unchanged single-string tuple keys after coverage and type checks, preserving dictionary fallback and canonical query semantics.

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

Copy link
Copy Markdown
Collaborator Author

Populated full-site Domain runs after the optimization, using the pinned deployed dataset (5,574 matching observations). Desktop 1440×1000 and mobile 390×844. These are real page captures, not mocked UI.

Domain runs on desktop with paginated related runs

Domain runs on mobile with paginated related runs

@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

Declarative-JSON directive: page-specific behavior remains entirely in Dashboard Language JSON. The declared domain-run-records query, table source, route arguments, ordering, filters, and lazy-list behavior specify the output. The JavaScript addition is generic storage execution only: prove unchanged single-field string equality from query shape, verify index coverage and string-only tuples, then seek the encoded key. It does not inspect page/view/query identities, special-case domain queries, perform main-thread filtering, or add a cache. Unsupported or coercion-sensitive shapes retain ordinary evaluation. Routing-run owns complementary run-derived identity selection and byRun reads, not another exact-key mechanism.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Superseded by the single consolidated draft PR #19015 at f0b769c. The reviewed source changes and preservation corrections are collected there, with regenerated catalogs and combined validation. Closing without merging or deleting the source branch; history and original evidence remain available.

@pelikhan pelikhan closed this Oct 19, 2026
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