# PR 46827 performance evidence

Environment: one Linux x86_64 KVM VM, 8 vCPUs (AMD EPYC), Chromium 158.0.0.0, Node 26.13.1, Vite 8.3.8 development builds, 1280x800 viewport, light theme. Same machine, browser and scripts for both commits. Fresh, isolated databases, no copied user data.

Base: 4374266d290a4bb35075be9835b00cccd5c9309a (merge-base with origin/main).
Head: 8457c7d3b0e3964ba49bd53771dbc83df9145d6b.

## Reproduce

1. Install dependencies with `vp i` in each checkout.
2. Start each with `T3CODE_DEV_SEED=0 T3CODE_ENVIRONMENT_LABEL='Performance demo' vp run dev`. Keep the returned process/session and use the actual printed server and web ports.
3. Copy seed.ts to scripts/perf-46827-seed.ts in each checkout. Run `node scripts/perf-46827-seed.ts http://127.0.0.1:<server-port> <thread-output.json>` from the checkout root. It uses the repository's real scenario RPC helper and app CLI. It creates a replay multi-turn thread and sequentially links and syncs 6433 synthetic, independent open PRs. Wait for seeded:6433. Seeding took 2280 and 2284 seconds; it is outside the measurements.
4. Copy measure.ts to apps/web/src/perf-46827.ts. In Chromium, open the printed pairing URL, wait for pairing to finish, then navigate directly to `/<environmentId>/<encoded-threadId>`. Read environmentId from `/.well-known/t3/environment` and threadId from the seed output. Wait for the rendered Synthetic change 6433 row.
5. Evaluate `window.job = import('/src/perf-46827.ts').then(m => m.measure('<threadId>')).then(r => window.result = r); 'started'` in that page. Do not await the whole expression through a tool with a 15-second limit; base takes longer. Once complete, collect `window.result` as JSON. Run three times for each commit. No simulated module, provider response, or source replacement is used.
6. For UI verification, record the browser, hover `button[aria-label^="PR #6433 - Open"]`, wait for Synthetic change 6432, retain the fully rendered preview, then stop recording. Both recordings show the same eight preview entries (#6433 through #6426), with +6425 more and the +6433 sidebar badge. The screenshots are the top 1280x450 region of the app. Each was pixel-identical to a second capture at least 500 ms later. Videos are supporting content verification, not end-to-end latency measurements.

## Measurement details

Each run collects 30 samples. Sidebar calls resolveThreadCurrentPullRequestLink twice and resolveThreadPullRequestBadge once. Hover calls pullRequestListLines(resolveThreadPullRequestChains(links)). Search calls threadSearchPullRequests({pullRequests:links}). Warm sidebar and hover samples batch 20 calls and divide elapsed time by 20; the same immutable array from the real app atom is reused. Each cold sample uses a structuredClone outside timing, runs sidebar first and then the first hover on that array. Thus cold hover means first hover after sidebar, not independently cold identity normalization. A preliminary head-only measurement with independent fresh arrays for hover is retained in the JSON and is not used for the comparison.

The timer resolution is 0.1 ms, so a zero batch/20 result is reported as below 0.005 ms, never literally zero or a precise sub-microsecond value. All raw samples, including GC outliers, are retained. Results are derivation timings in the real app's browser, not hover-to-paint or full sidebar render latency.

All three runs on both sides have identical SHA-256 hashes for the full ordered sidebar, hover and search outputs. Hashing removes threadId, linkedAt and lastSyncedAt because fresh seeds differ in identifiers and wall-clock times. It retains PR identities, snapshots, titles, selected PR, chain/list order and search order. Badge is {kind:'pull-request', others:6432, state:'open'} on both. Hover and search each contain 6433 entries.

Median-of-run-medians (range of three run medians), milliseconds:

| Derivation | Base | Head |
| --- | ---: | ---: |
| Cold sidebar | 60.65 (58.45–63.20) | 42.75 (41.35–44.65) |
| First hover after sidebar | 8.35 (8.30–8.55) | 1.20 (1.20–1.20) |
| Warm sidebar | 19.09 (18.85–22.07) | <0.005 (all runs) |
| Warm hover | 7.97 (7.72–8.84) | <0.005 (all runs) |
| Search | 1.70 (1.70–1.80) | 1.05 (1.00–1.10) |

The improvement in each median exceeds the spread between the three run medians. Individual samples contain outliers, especially cold derivations; this is a median claim, not a worst-case guarantee. Exact performance values in the PR are not replicated because its hardware and harness were unspecified. Mobile, desktop shell and cache invalidation after subsequent edits were not measured.
