perf: reduce docs sidebar prefetch eagerness#289
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a573134b60
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (pathname.startsWith('/assets/') || contentType.includes('javascript')) return 'js' | ||
| if (contentType.includes('text/css') || pathname.endsWith('.css')) return 'css' |
There was a problem hiding this comment.
Count off-route asset fetches in off-route totals
In captureNetworkSummary, asset requests are bucketed as js/css/image before checking whether they belong to the current route, so prefetched chunks for other pages are never labeled off-route. Because offRouteBytes and offRouteRequests are later computed only from category === 'off-route', the harness under-reports off-route traffic on pages that prefetch route assets, which can materially skew the benchmark comparisons this script is intended to produce.
Useful? React with 👍 / 👎.
| if (!output) return | ||
| cleanup() | ||
| reject(new Error(output)) |
There was a problem hiding this comment.
Avoid failing preview detection on non-error stderr logs
detectPreviewUrl currently rejects as soon as any non-empty stderr chunk is emitted, which makes the harness fail even when pnpm preview is healthy but prints warnings/noise to stderr (for example runtime warnings). This creates flaky startup failures unrelated to server availability and can block perf runs in otherwise valid environments.
Useful? React with 👍 / 👎.
a573134 to
c996f6c
Compare
c996f6c to
00ca8af
Compare
Summary
vocstowevm/vocs#420, which adds configurable link prefetching (none,intent,view)prefetch: 'intent'so visible sidebar links no longer eagerly warm every route on page loadscripts/perf-harness.tspluspnpm perf:harnessto measure route-level Lighthouse metrics, no-interaction network attribution, and cold-vs-intent sidebar navigation latencyBenchmark Summary
Switching sidebar prefetching from
viewtointentcuts off-route load bloat on heavy docs pages without materially slowing navigation./accounts/quickstart/faucet/guide/payments/send-a-payment/guide/stablecoin-dex/providing-liquidityNavigation on
/guide/payments/send-a-paymentstayed effectively flat:83ms -> 87ms104ms -> 103msA fresh spot-check from this branch reproduced the same shape:
/guide/payments/send-a-payment:534.3 KBoff-route,97mscold click,94msintent clickVerification
bun run check:typesbun run check(existing unrelated warnings remain inscripts/lighthouse.tsandsrc/components/guides/EmbedPasskeys.tsx)bun run buildbun run perf:harness --pages /guide/payments/send-a-payment --runs 1 --skip-build --skip-bundle