Tune Node server chunking for require overhead (#99120)
### What? Tune production Node.js server JavaScript chunking to use a lower estimated cost for loading a chunk, a smaller soft minimum chunk size, and no per-group chunk-count target. Client, CSS, Edge, and development chunking remain unchanged. ### Why? Server chunks are loaded with Node.js `require()`, not network requests. Measurements across synthetic JavaScript chunks found roughly 0.1 ms of fixed load overhead, equivalent to approximately 2.5–25 KB of parsing work depending on code density. The existing 200 KB estimate overweights each server-side load and encourages unnecessary merging. ### How? Apply the server-specific tuning to both Node production chunking contexts while keeping the existing maximum merge size. The values are an initial estimate from the benchmark; representative application builds and cold-start measurements can refine them. ### Verification - `cargo fmt --manifest-path crates/next-core/Cargo.toml -- --check` — passed. - `git diff --check` and checks of both Node contexts and unchanged Edge values — passed. - `cargo check -p next-core --offline` — blocked before compilation by an uncached `bgw/bincode` Git dependency. <!-- NEXT_JS_LLM --> <!-- fleet 8b0bc78c-72fb-424d-a85e-c5a5b87ff5f4 --> Co-authored-by:vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment