Repository navigation
perf(web): cold repo home within the S-1 request budget - #142
Conversation
…es (S-1) The cold repo home made 27-51 DAPI requests on the showcase mirrors (114 on dashpay/dash) against the S-1 budget of 25. One composite now resolves the repo and reads star/issue/PR counts, members, the owner's DPNS name and the first page of the config, ref-update and pack-manifest timelines; those timelines are append-only, so a per-repo store keeps them and later reads ask only for the delta. The browse context's pack list and the PR list's base refs come from the same store. Identical reads in flight are joined, the protocol-13 boundary-tie probe is skipped on protocol 14 (Drive pads the cursor itself), and the below-the-fold About facts and latest release are read once in view, behind skeletons. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…l skeletons Code-simplifier findings: one delta bound for the composite page and its continuation, a shared in-flight helper for query dedupe and the chrome read, a single latch per repo for the About facts, one Skeleton for the deferred rail cards, and a flatter request decoder in the e2e helpers. No behaviour change. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…der only while a load runs Review findings on the S-1 chrome store. M1: a write bumps the repo's write generation; in-flight chrome reads are joined only within a generation and a read issued before the write is not kept, so the next reader always reads after it. M2: the About facts placeholder shows only while the home has a load of that tip registered; deep links, empty repos and failed loads show nothing, as before. L1/L2/L3: membership seeds skip reads that straddle a member change, query dedupe keys carry a per-SDK write epoch, and seeded tab totals are rejected when this browser created one after the read was issued. Also: delta reads only on protocol 14, a counted and logged plain-query fallback, a 20-repo LRU, bounded facts latches whose aborted waiters detach, and a live test of the delta composite. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…r the home is left Re-review of the S-1 store: a config write (one of the four stored timelines) now calls repoContentWritten, so the chrome store, home and browse context read after it. A facts load left mid-read still publishes what it read, so another route of the tip does not keep a placeholder. The issue and PR page composites pass the membership generation they started at, and the parameter is required. The facts latch trim never drops the latch it just made, and a stored delta base is kept only for the same repo. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedNext included review available in 3 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (30)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review 🤖 Posted autonomously by Claude on behalf of pasta. |
|
Summary
S-1 (
platform-parity-spec.md) budgets a cold repo page at ≤ 25 DAPI requests. The showcase mirrors' homes made 30–51, and dashpay/dash made 114. This PR brings every showcase home under 25, and the fixture home from 26 to 8, once the file list's commit-column walk is left out. That walk is being replaced by the push-time last-change index, owned by another agent. dash is the documented large-repo bound. The CI budget inrepo-home-latencydrops from 120 to 40 (60 for dash).What changed
One composite for the whole repo chrome (
lib/repo/chrome.ts, new). The page is therepodocument by($ownerId, name), with 10 sub-queries bound$id → repoId:star,issueandpatch;maintainerandwriterlookups;config,refUpdate,protectedRefUpdateandpackManifest;domain.This replaces about 12 separate requests: resolve, config, the ref keyset scan, star, both counts, members, manifests and DPNS. A full page is continued with plain
startAfterpages. The home now folds refs from the completereflogtimeline, which is the keyset scan's own trusted fallback, so no ref can be cut off at a page boundary.A per-repo timeline store. Those four types are
documentsMutable: falseandcanBeDeleted: false, so a later read asks only for rows with$createdAt >=the newest one held, merged by$id. The browse context's pack list (readBrowseManifests) and the PR list's base refs and config come from the same store. A revalidation costs 1 request whatever the repo's size. The store is marked stale on this tab's writes (onRepoContentWritten), and a re-resolve after a miss reads fresh.Identical reads in flight are joined (
lib/sdk/query.ts). This covers documents and counts, and only while a read is out.The protocol-13 boundary-tie probe is skipped on protocol 14. Drive's
pads_cursor_pagealready continues astartAfterpage within its tie. It is gated onnon_primary_key_path_query >= 1, which protocol 14 first sets (compound_cursor_tests.rs).Deferred below the fold, with skeletons: the About card's LICENSE row and language bar (a tree walk that costs 47 requests on dash) and the Latest release card. They load once scrolled into view. The About card starts at y≈896 in a 900 px window.
Smaller cuts:
Before / after (cold, fresh Chromium context, counted until network idle)
Before: forge.dashhq.org at master, which matched a local build of master request for request. After: this branch built locally against moutai (beta.6). The "walks" column is the history walks (the commit column and the count; 256 KiB read-ahead chunk reads).
Everything is in
dash-forge-qa/evidence/impl/perf-cold-home-dapi-budget/PERF.md: every request decoded, per-feature attribution from call stacks, the bounds, and why preact needed 51 while dips needed 30 (ref updates, releases and history depth; pack count played no part).Protocol shapes (none invented)
Each shape was checked against Platform 4.2.0-beta.6 source and with read-only probes on moutai:
countson arangeCountableindex;repoIdfirst;$createdAt >=on a bound lookup;count.Review
code-review-validator: approved with suggestions. All applied in
fix(web): no read answers across this tab's write…:lib/repo/chrome.live.test.ts. It passes on moutai for forge-v2-demo and preact, and the delta composite is accepted with no fallback.A focused re-review of that commit found four more, all fixed in
fix(web): a config write stales the repo's caches…:code-simplifier: applied as
refactor(web): simplify….Latency note (not a regression)
On the final run, rhl-1 and rhl-2 (the time-to-list checks) failed. The request budgets passed. At the time moutai answered every page about 4× slower than earlier in the day: the same 7-page
refUpdateread inprobe-reflog.mjstook 5.0 s, against 1.3 s earlier. forge.dashhq.org (master) took 7.7 s to first paint for preact in the same window. Earlier today, rhl-1 and rhl-2 passed against this branch, and the request counts are unchanged.UX
Nothing on the home disappears. The deferred facts and latest release show a pulsing skeleton (
role=status) until they are scrolled into view, then fill in, and the settled rail text matches master's. axe passes (a11y,v2-home), and so doesmobile.spec.Tests
lib/repo/chrome.test.tscovers the one-request chrome, continuation pages, deltas, the store serving the pack list, joining in-flight reads, staleness after writes, and a renamed repo.lib/sdk/query.test.tscovers dedupe and the tie probe per protocol.lib/view/repo-facts.test.tscovers the in-view gate. The full suite passes (2757).e2e/page-budget.spec.ts.repo-home-latencyrhl-1's budget drops from 120 to 40 (dashE2E_MAX_DAPI=60, measured 49).page-budget,v2-home,rate-budget,code-browsing-parity,v2-reads,v2-issues,v2-pulls,repo-settingsanda11y.repo-home-latencyrhl-1/rhl-2 failed on time-to-list only, because moutai was about 4× slow; see the latency note. The live composite test passes (chrome.live.test.ts).Out of scope, reported to the orchestrator
wasm_sdk_bg.wasmis already optimised.wasm-opt -Ozsaves nothing: 23.4 MB, 8.06 MB gzip, 5.2 MB brotli. The gain there is in shipping brotli and immutable caching (Pages servesmax-age=14400, gzip).🤖 Generated with Claude Code