Skip to content

perf: mdx build time - #62

Draft
MohamedH1998 wants to merge 4 commits into
mainfrom
perf/mdx-build-time
Draft

perf: mdx build time#62
MohamedH1998 wants to merge 4 commits into
mainfrom
perf/mdx-build-time

Conversation

@MohamedH1998

@MohamedH1998 MohamedH1998 commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Outcome: closed experiment — no measurable win

Build-time perf experiment for large sites (measured on Cloudflare Docs, ~8.7k
pages). All framework-only (packages/nimbus-docs). Conclusion: correct and safe,
but no measurable build-time win on the current stack — not shipping.

Two MDX-compile changes were tried here:

  1. Skip the MDX partial-heading parse on Render-free pagesmergePartialHeadings
    only injects headings from <Render> slots, so a body without one is a pure
    pass-through; the mdxToMdast parse is skipped for it (byte-identical output,
    ~4,900 of ~6,700 cf-docs pages).
  2. Opt-in persistent MDX compile cache (mdxCache option, default off) — disk
    cache around the @mdx-js/rolldown transform; a hit skips the compile.

A CI/A-B check showed no measurable change: this branch built in 367s vs 365/374s on
unrelated PRs (within noise). cf-docs's build is bound by bundling + rendering, not
the MDX compile these changes touch, so skipping/caching that work is a rounding
error. Same story as the sibling prerender-hashing experiment (#57), whose original
win also evaporated once Rolldown sped up its chunk hashing.

Disposition: closing unmerged. The two changesets on this branch never reach
main, so there's no release impact. Kept here as a documented negative result.

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

pkg-pr-new Bot commented Jul 26, 2026

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

commit: b4afebe

@MohamedH1998

Copy link
Copy Markdown
Collaborator Author

CI shows no measurable change: this branch built in 367s vs 365/374s on unrelated PRs (within noise). cf-docs's build is bound by bundling + rendering, not the MDX compile these changes touch - so skipping/caching that work is a rounding error.

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