Skip to content

perf: eliminate repeated result parsing during static export - #372

Merged
joshblack merged 1 commit into
mainfrom
copilot/investigate-deploy-times
Oct 9, 2026
Merged

joshblack merged 1 commit into
mainfrom
copilot/investigate-deploy-times

Conversation

Copilot AI commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Deploys spent 76 minutes generating 3,224 routes because each benchmark asset and file preview reparsed every historical run.

  • Targeted loading: Read only the requested benchmark date; retain full-history loading for overviews.
  • Bounded reuse: Share in-flight parsed bundles through production-only LRU caches, capped at two bundles per reader. Retry failed reads and keep development reads uncached.
  • Measured impact: On the same 50-trial dataset, static generation fell from 5 minutes to 7.1 seconds across 745 routes. All 719 exported data assets remained byte-identical; full production timing remains unmeasured.

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Copilot AI changed the title perf: speed up website static exports perf: eliminate repeated result parsing during static export Oct 9, 2026
Copilot AI requested a review from joshblack October 9, 2026 18:55
@joshblack
joshblack marked this pull request as ready for review October 9, 2026 19:07
Copilot AI balanced review requested due to automatic review settings October 9, 2026 19:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation is focused and well-tested; the remaining test-colocation comment is non-blocking.

1 open finding
What changed in this PR

Optimizes static export by avoiding repeated parsing of historical result bundles.

Changes:

  • Adds bounded production LRU caches for parsed result bundles.
  • Loads only the requested benchmark run.
  • Adds regression, caching, eviction, retry, and development-mode tests.
File Description
website/​src/​result-files.ts Adds production-only result caching.
website/​src/​result-files.test.ts Tests targeted loading and cache behavior.
website/​src/​benchmark-results.ts Loads benchmark runs by requested date.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

return filepath
}

test('getBenchmarkRun reads only the requested date, not broken historical bundles', async () => {
@joshblack
joshblack merged commit 831f2d3 into main Oct 9, 2026
9 checks passed
@joshblack
joshblack deleted the copilot/investigate-deploy-times branch October 9, 2026 19:32
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.

3 participants