Skip to content

Performance degradation after turning on new tree shaking #5123

@chenjiahan

Description

@chenjiahan

System Info

@rspack/core: 0.4.5

System:
OS: macOS 13.5.2
CPU: (10) arm64 Apple M1 Pro
Memory: 1.69 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
npm: 9.3.1 - ~/Library/Application Support/fnm/node-versions/v18.14.1/installation/bin/npm
pnpm: 8.8.0 - ~/Library/Application Support/fnm/node-versions/v18.14.1/installation/bin/pnpm
Browsers:
Chrome: 120.0.6099.129
Safari: 16.6

Details

I have tried to enable tree shaking in the Vant website, and found that the compile time increased from 3s to 23s.

  • newTreeshaing: false:

image

  • newTreeshaing: true:

image

Reproduce link

https://github.com/youzan/vant/tree/new_tree_shaking_1226

Reproduce Steps

Enable new tree shaking:

  1. git clone [email protected]:youzan/vant.git --branch new_tree_shaking_1226
  2. pnpm i
  3. pnpm dev

Disable new tree shaking:

  1. search newTreeshaking: true, change the value to false.
  2. pnpm i (to trigger rebuild)
  3. pnpm dev

Metadata

Metadata

Labels

bugSomething isn't workingpending triageThe issue/PR is currently untouched.rsbuildrsbuild relatedteamThe issue/pr is created by the member of Rspack.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions