Skip to content

perf(ssg): regression after output.asyncChunks = true#2674

Merged
SoonIter merged 2 commits intomainfrom
syt/ssg-perf
Oct 21, 2025
Merged

perf(ssg): regression after output.asyncChunks = true#2674
SoonIter merged 2 commits intomainfrom
syt/ssg-perf

Conversation

@SoonIter
Copy link
Copy Markdown
Member

@SoonIter SoonIter commented Oct 21, 2025

Summary

#2295

a large rspress site with 4000+ pages

V1 before

image

V2 after

 info    Rendering pages...                                                  
 success Pages rendered in 14048 ms                                   
 ready   built in 25.2 s (web)
 ready   built in 37.5 s (node)

Regression reasom

OOM because of the sourcemap size after splitting to small chunks, every soucemap file size is 30 MB + cause that large GC process

image

Related Issue

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 21, 2025 11:36
@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 21, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 1074910
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/68f77337be892c0008027fd4
😎 Deploy Preview https://deploy-preview-2674--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a performance regression related to SSG (Static Site Generation) builds when output.asyncChunks = true is enabled. The change refactors the bundler chain configuration to use the new environment API instead of the deprecated target parameter, and explicitly disables async chunks for Node.js SSG builds.

Key Changes:

  • Migrated from target parameter to environment API in bundler chain configuration
  • Replaced chain.target('async-node') with chain.output.set('asyncChunks', false) to prevent async chunk generation in SSG builds

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread packages/core/src/node/initRsbuild.ts
Comment thread packages/core/src/node/initRsbuild.ts
@SoonIter SoonIter requested a review from Timeless0911 October 21, 2025 11:55
@SoonIter SoonIter enabled auto-merge (squash) October 21, 2025 11:57
@SoonIter SoonIter merged commit 54407c2 into main Oct 21, 2025
11 checks passed
@SoonIter SoonIter deleted the syt/ssg-perf branch October 21, 2025 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants