Skip to content

perf: hashless prerender bundles - #57

Draft
MohamedH1998 wants to merge 2 commits into
mainfrom
perf/hashless-prerender-bundles
Draft

perf: hashless prerender bundles#57
MohamedH1998 wants to merge 2 commits into
mainfrom
perf/hashless-prerender-bundles

Conversation

@MohamedH1998

Copy link
Copy Markdown
Collaborator

What & why

Skip hashing Astro's temporary prerender bundle - shout out @ttmx for this

Speeds up large docs builds by giving Astro's throwaway prerender bundle
hashless filenames, so Rolldown skips its per-chunk hash-graph walk.

Why

Astro imports the prerender bundle to render static pages, then deletes it. On
large sites, hashing its thousands of lazy content chunks dominates the build —
Rolldown re-walks the transitive chunk graph once per hash placeholder, which is
wasted work on an intermediate that's thrown away.

Cloudflare Docs (~8.7k pages), isolated cold-build A/B:

Wall time Prerender bundling
Before (hashed) 7:44 3:51
After (hashless) 5:24 1:39

~30% less wall time, ~57% less prerender bundling.

What

  • Hashless entry/chunk names for the prerender environment only — shipped
    client and asset hashes are unchanged.
  • Writes Astro 7's native rolldownOptions output key, not the
    deprecation-track rollupOptions alias.
  • Stays out of the way

Checklist

  • A maintainer approved this work (lgtm+ on my issue or discussion), or I'm on the team
  • Correct tier (framework / starter / registry) per the boundary test
  • Edited packages/nimbus-starter-source/, not the templates branch
  • Changeset added (create-nimbus-docs changeset if the starter changed)
  • pnpm typecheck, pnpm -r test, and pnpm templates:check all green
First time here?

Nimbus works from issues and discussions, not drive-by PRs, so unapproved PRs from
outside the team are closed automatically. If that's you, open an
issue (bug or fix proposal)
or a discussion (feature) instead —
once a maintainer approves you there, your PRs stay open. See
CONTRIBUTING.md.

@MohamedH1998 MohamedH1998 added the pr preview Publish a pkg.pr.new preview for this PR label Jul 24, 2026
@github-actions github-actions Bot removed the pr preview Publish a pkg.pr.new preview for this PR label Jul 24, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 24, 2026

Copy link
Copy Markdown
pnpm add https://pkg.pr.new/@cloudflare/create-nimbus-docs@57
pnpm add https://pkg.pr.new/@cloudflare/nimbus-docs@57

commit: 5149194

@MohamedH1998

MohamedH1998 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Ran a cold A/B on the Cloudflare Docs build to check the real-world win
vite 8.1.5 / rolldown 1.1.5, 8,710 pages, 20,786 prerender chunks. Same
package, only the prerender hashing toggled:

Prerender bundle phase Total
Hashed (baseline) 1m53s 212s
Hashless (this PR) 1m50s 222s

The override works as intended — prerender chunks come back hashless — but it
saves ~3s here, within noise. For reference, even the hashed bundle phase is
1m53s, vs the 3m51s in the original measurement.

Looks like Rolldown has since sped up its chunk hashing, so the bottleneck this
targets is largely gone on the current stack. The change itself is correct and
safe — there's just no measurable build-time win anymore 😔.

Draft PR in the Cloudflare docs: cloudflare/cloudflare-docs#32304

@MohamedH1998
MohamedH1998 marked this pull request as draft July 27, 2026 14:45
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.

2 participants