perf: let jsx-ast and html start on their dependency's first chunk #1241
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 268 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.335
Real PR Conversation Timeline
1 comments
"Review active on #1241"
general
weight: 0.35
avivkeller
<!--
Please read the Code of Conduct and the Contributing Guidelines before opening a pull request.
-->
Description
This PR lets
jsx-astandhtmlstart on their dependency's first chunk, so with more than one thread, page building and rendering overlap with the generators before them. It's part of the stack that splits #1205.jsx-astbuilds each page as its module's entries arrive. Once its input ends, it emits{ manifest }, every page's head in the order the site lists them, without waiting for the pages still being built.htmlcompiles each page as it arrives, bundles the component library and the client assets as soon as the manifest does, and renders the pages as they're compiled.compilecan now run before and alongsidebuildServerandbuildClient.jsx-astnow yields pages in the order their entries arrive, plus the{ manifest }item, which is a breaking change for anything reading its output.| Site build |
main| This PR || --- | --- | --- |
| 4 threads | 9.82s, 1728MB | 8.12s (-17%), 2179MB (+26%) |
| 6 threads | 8.56s, 2280MB | 6.82s (-20%), 2821MB (+24%) |
Full Node.js docs, medians of 5 runs. The extra memory is stages that ran one after the other now running at once.
Validation
Added tests for
jsx-astbuilding pages as they arrive and sending the manifest whileworker.streamholds back its next batch, and forhtmlbundling once the manifest arrives and building the same site from its whole input. On 12 of Node.js's API docs, the output is byte-identical tomain's at 1 and 4 threads.Related Issues
Refs: #1205
Check List
node --run testand all tests passed.node --run format:check&node --run lint.