Repository navigation
Replies: 1 comment
|
I can open a pull request for this once triage confirms the direction. I have not written it yet. One option is to keep each link's identifying fields in the thread shell and load its |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What happened
GET /api/orchestration/shell(ProjectionStoreV2.getShellSnapshot) puts every pull request link on every thread shell. Each link carries its fullsnapshot(title, branches, author with avatar URL, line counts, checks, merge state) and itsstack. On a real database (1,404 active and 207 archived threads, 17,359 links, 159 links on the busiest thread) the snapshot is 17.0 MB of JSON, 1.78 MB gzipped. Withsnapshotandstackdropped from each link it is 6.5 MB, 0.33 MB gzipped. #16713 found the same ratio on another database (9.5 of 11.7 MB).Diagnosis
threadShellFromProjectionandshellFromStatecopythreadPullRequestsOf(thread)into the shell unchanged (apps/server/src/orchestration-v2/ProjectionStore.ts:1473and:1741), andOrchestrationV2ThreadShelldeclares the fullThreadPullRequestLinkarray (packages/contracts/src/orchestrationV2.ts:1940).Server cost per snapshot read, measured by calling
getShellSnapshotthrough a read-only connection to a live database (median of 7 repetitions, two runs, warm page cache):JSON.stringifyThat is about 0.4 s of main-thread work. Decoding and encoding the links alone, in isolation (16,210 links on the active threads), takes 35 ms and 33 ms, so about a quarter to a third of the decode and encode stages.
Wire and client cost for the same snapshot:
snapshotandstackJSON.parseThe client already decodes the links after the rows (
decodeShellSnapshotDeferringPullRequests, #16713), so its remaining cost is bandwidth and parse. The server still reads, decodes, encodes and compresses every body on every client connect, and for each background pass that reads the shell.Not measured: the server stages for the slimmer payload (only parse and gzip were), a real network, or a device. Repeat-run spread was about 7%. Byte sizes are exact.
Steps to reproduce
ProjectionStoreV2.getShellSnapshot({})and time it, then encode the result withSchema.toCodecJson(OrchestrationV2ThreadShellSnapshot)and measure the JSON and gzip size.snapshotandstackfrom each link to see the size the shell would have without the bodies.I have a small harness that does this and can share it.
Version
upstream/main at dc19285 (2026-10-13)
Environment
Linux (WSL2), Node 24, 16 vCPU. One database, 16.5 GB, 1,404 active V2 threads.
Evidence
Related issues
#14703 (read moves to a worker, payload unchanged), #16713 (client defers link decode), #16558 (PR sync event stores whole thread), #18559 (compaction never runs). This one is the shell payload sent to clients.
Fix applied or workaround
None. Would you take a shell that carries a compact link (key, URL, state), with the bodies fetched when the pull request panel opens or a row is on screen? It changes the shell contract for web, mobile and desktop, so I would like your direction before writing it. I have not written the change.
Filed by
Claude Sonnet 5.5, in Claude Code
All reactions