Skip to content

[docs-infra] Reduce LLM generation memory - #5488

Merged
flaviendelangle merged 2 commits into
mui:masterfrom
flaviendelangle:fix-llms-generation-memory
Aug 21, 2026
Merged

flaviendelangle merged 2 commits into
mui:masterfrom
flaviendelangle:fix-llms-generation-memory

Conversation

@flaviendelangle

Copy link
Copy Markdown
Member

Summary

  • format each page of llms-full.txt before concatenating the aggregate document
  • avoid constructing a multi-million-node Prettier document for the complete documentation corpus
  • preserve the exact formatted output

Motivation

Prettier’s Markdown formatting memory grows disproportionately when llms-full.txt is formatted as one multi-megabyte document. Additional documentation pushed the generator past Node’s default 2 GB heap, causing every release:build consumer and the Netlify build to fail before their actual build or test step.

This is a docs infrastructure scaling issue, not a runtime memory leak.

Verification

  • NODE_OPTIONS=--max-old-space-size=2048 pnpm docs:generate-llms
    • before: deterministic heap OOM near 2 GB with the larger documentation corpus
    • after: succeeds with approximately 427–438 MB peak RSS
  • compared the new aggregate output with a whole-file Prettier pass: byte-for-byte identical
  • pnpm eslint docs/scripts/generateLlmTxt/index.mjs
  • pnpm prettier --check docs/scripts/generateLlmTxt/index.mjs

@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

commit: 960c128

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 1,177.81 ms +39.70 ms(+3.5%) | Renders: 76 (+0) | Paint: 1,825.76 ms +80.40 ms(+4.6%)

Test Duration Renders
Combobox open — 500 items 45.46 ms 🔺+7.86 ms(+20.9%) 4 (+0)
Checkbox mount (500 instances) 67.19 ms ▼-28.12 ms(-29.5%) 1 (+0)

13 tests within noise — details


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 960c128
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a7de09190fee400083c274a
😎 Deploy Preview https://deploy-preview-5488--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@flaviendelangle flaviendelangle added type: bug It doesn't behave as expected. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). labels Aug 13, 2026
@flaviendelangle flaviendelangle self-assigned this Aug 20, 2026
@flaviendelangle
flaviendelangle requested a review from a team August 20, 2026 10:19

@brijeshb42 brijeshb42 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.

Nice improvement. Good candidate to carry over to other repos.

@flaviendelangle
flaviendelangle merged commit 743c531 into mui:master Aug 21, 2026
23 checks passed
@flaviendelangle
flaviendelangle deleted the fix-llms-generation-memory branch August 21, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants