-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build performance optimizations for projects with large sidebars #2252
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
* main: (240 commits) i18n(de): update some files for consistency in German language (withastro#2502) i18n(zh-cn): Update `plugins.mdx` (withastro#2501) i18n(de): translate guides/pages (withastro#2469) i18n(de): translate components/code (withastro#2457) i18n(de): translate components/using-components (withastro#2455) [ci] format i18n(de): translate guides/site-search (withastro#2481) i18n(de): update translation guides/customization (withastro#2475) i18n(de): update translation manual-setup (withastro#2479) i18n(de): update translation reference/overrides (withastro#2480) i18n(de): translate reference/plugins (withastro#2464) i18n(de): update translation guides/authoring-content (withastro#2458) [ci] format i18n(de): update translation reference/configuration (withastro#2459) i18n(de): update translation reference/frontmatter (withastro#2470) [ci] format i18n(de): update translation guides/i18n (withastro#2476) i18n(de): update `resources/plugins.mdx` (withastro#2498) i18n(ko-KR): update `plugins.mdx` (withastro#2500) i18n(fr): Update `resources/plugins` from withastro#2493 (withastro#2496) ...
Undrafting the PR as I've been playing quite a bit with the changes and didn't see any downside to the current approach. I still want to do a little bit of play-testing with some SSR scenarios but I thought I might as well undraft the PR before I forget as usual and in case some users want to provide some feedback in the meantime. |
Description
This PR is a draft experimenting with a new approach to fix #2215 by caching generated sidebars per locale to avoid regenerating them for each page during the build process.
A few details about the approach:
Map
at the moment.docs
content collections pages and<StarlightPage>
not specifying a custom sidebar (which means the sidebar generated based on the globalsidebar
config is used).<StarlightPage>
with a custom sidebar would probably require a hash of the custom sidebar config so I decided to keep it simple for now and it's not required to get an idea of the potential performance improvements (there is also no guarantee that generating such a hash would not kill the performance improvements from the caching).Here are some benchmarks I ran on my machine:
Starlight Docs
Before:
After:
Cloudflare Docs (no patch)
astro check
has been removed from thebuild
npm script as it's not really relevant for this benchmark.Before:
After:
Cloudflare Docs (with patch)
astro check
has been removed from thebuild
npm script as it's not really relevant for this benchmark.Before:
After:
A few interesting points: