Skip to content

fix(perf): fetch bench variants on demand, stop embedding the full matrix - #399

Merged
Flotapponnier merged 1 commit into
devfrom
feat/per-chain-bench-pages
Jun 11, 2026
Merged

fix(perf): fetch bench variants on demand, stop embedding the full matrix#399
Flotapponnier merged 1 commit into
devfrom
feat/per-chain-bench-pages

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause of the 30-60s bench page loads (measured 52s TTFB): every ISR regeneration awaited the full chain×region×kind variant matrix (39 full provider loads on rpc-capabilities) before responding, and build logs show the related data-cache items exceed Vercel's 2MB cap so they never cache
  • The page now ships ONLY the aggregate view; BenchmarkBody fetches a variant from the new /api/bench/[slug]/variant route when a tab is flipped (validated filters, editorial override preserved, s-maxage=60 + per-variant unstable_cache dedupes across users)
  • While a variant loads the aggregate keeps rendering, so tab flips never blank; failed fetches keep the aggregate

Test plan

  • tsc, bun test
  • Staging: TTFB sub-second on bench pages after warm-up, tab flips populate chain/region data within ~500ms, tab summary chips fill as variants load

Every ISR regeneration awaited the full chain x region x kind variant
matrix (39 full provider loads on rpc-capabilities) and shipped it in
the page payload; any visitor landing on a blocking render path ate
30-60s. The page now renders the aggregate only; BenchmarkBody fetches
a variant from /api/bench/[slug]/variant on tab flip (per-variant
unstable_cache dedupes across users, aggregate renders while loading).
@Flotapponnier
Flotapponnier merged commit fa07669 into dev Jun 11, 2026
1 check failed
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