Skip to content

Bundle size is 19kB (31%) bigger with svelte project #229

Open
@KieranP

Description

@KieranP

Describe the performance issue

Using this repo as a test: https://github.com/KieranP/Github-Releases-Feed (Vite + Svelte + LightningCSS)

Ran old vite 5x, run new rolldown-vite 5 times using time (i.e. real wall time, not just vites reported build time, since build time alone doesn't give an accurate picture of all parts involved).

Building (warm cache) is roughly 33% faster with enableNativePlugin false (1.052s down to 0.71s on avg), and up to 43% faster with enableNativePlugin true (1.052s down to 0.60s on avg). But the resulting package is ~31% bigger in both cases (62.62 kB up to 81.97 kB).

Nothing changes in application code, I simply swapped vite with rolldown-vite as per blog post. And the project is small, not much if any dead code within my code. So best guess is something is not getting tree-shaken correctly, some lib is including more than it should?

Reproduction

https://github.com/KieranP/Github-Releases-Feed

Performance Metrics

vite:

› time yarn build
vite v6.3.5 building for production...
✓ 444 modules transformed.
dist/index.html                  0.51 kB │ gzip:  0.31 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.68 kB
dist/assets/index-0q1ncWN4.js   62.62 kB │ gzip: 23.16 kB
✓ built in 363ms
yarn build  1.06s user 0.16s system 133% cpu 0.910 total

› time yarn build
vite v6.3.5 building for production...
✓ 444 modules transformed.
dist/index.html                  0.51 kB │ gzip:  0.31 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.68 kB
dist/assets/index-0q1ncWN4.js   62.62 kB │ gzip: 23.16 kB
✓ built in 363ms
yarn build  1.03s user 0.15s system 130% cpu 0.909 total

› time yarn build
vite v6.3.5 building for production...
✓ 444 modules transformed.
dist/index.html                  0.51 kB │ gzip:  0.31 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.68 kB
dist/assets/index-0q1ncWN4.js   62.62 kB │ gzip: 23.16 kB
✓ built in 360ms
yarn build  1.05s user 0.15s system 133% cpu 0.907 total

› time yarn build
vite v6.3.5 building for production...
✓ 444 modules transformed.
dist/index.html                  0.51 kB │ gzip:  0.31 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.68 kB
dist/assets/index-0q1ncWN4.js   62.62 kB │ gzip: 23.16 kB
✓ built in 364ms
yarn build  1.05s user 0.16s system 133% cpu 0.907 total

› time yarn build
vite v6.3.5 building for production...
✓ 444 modules transformed.
dist/index.html                  0.51 kB │ gzip:  0.31 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.68 kB
dist/assets/index-0q1ncWN4.js   62.62 kB │ gzip: 23.16 kB
✓ built in 369ms
yarn build  1.07s user 0.16s system 134% cpu 0.909 total

rolldown-vite (enableNativePlugin = false)

› time yarn build
rolldown-vite v6.3.18 building for production...
✓ 441 modules transformed.
dist/index.html                  0.51 kB │ gzip:  0.31 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.68 kB
dist/assets/index-CsmkX_yS.js   81.97 kB │ gzip: 29.30 kB
✓ built in 204ms
yarn build  0.71s user 0.31s system 132% cpu 0.769 total

› time yarn build
rolldown-vite v6.3.18 building for production...
✓ 441 modules transformed.
dist/index.html                  0.51 kB │ gzip:  0.31 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.68 kB
dist/assets/index-CsmkX_yS.js   81.97 kB │ gzip: 29.30 kB
✓ built in 203ms
yarn build  0.71s user 0.31s system 134% cpu 0.761 total

› time yarn build
rolldown-vite v6.3.18 building for production...
✓ 441 modules transformed.
dist/index.html                  0.51 kB │ gzip:  0.31 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.68 kB
dist/assets/index-CsmkX_yS.js   81.97 kB │ gzip: 29.30 kB
✓ built in 197ms
yarn build  0.70s user 0.26s system 127% cpu 0.757 total

› time yarn build
rolldown-vite v6.3.18 building for production...
✓ 441 modules transformed.
dist/index.html                  0.51 kB │ gzip:  0.31 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.68 kB
dist/assets/index-CsmkX_yS.js   81.97 kB │ gzip: 29.30 kB
✓ built in 204ms
yarn build  0.71s user 0.31s system 134% cpu 0.755 total

› time yarn build
rolldown-vite v6.3.18 building for production...
✓ 441 modules transformed.
dist/index.html                  0.51 kB │ gzip:  0.31 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.68 kB
dist/assets/index-CsmkX_yS.js   81.97 kB │ gzip: 29.30 kB
✓ built in 200ms
yarn build  0.70s user 0.30s system 129% cpu 0.773 total

rolldown-vite (enableNativePlugin = true)

› time yarn build
rolldown-vite v6.3.18 building for production...
✓ 441 modules transformed.
dist/index.html                  0.50 kB │ gzip:  0.30 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.67 kB
dist/assets/index-DIRflXaC.js   81.97 kB │ gzip: 29.29 kB
✓ built in 131ms
yarn build  0.60s user 0.26s system 131% cpu 0.659 total

› time yarn build
rolldown-vite v6.3.18 building for production...
✓ 441 modules transformed.
dist/index.html                  0.50 kB │ gzip:  0.30 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.67 kB
dist/assets/index-DIRflXaC.js   81.97 kB │ gzip: 29.29 kB
✓ built in 130ms
yarn build  0.60s user 0.27s system 131% cpu 0.659 total

› time yarn build
rolldown-vite v6.3.18 building for production...
✓ 441 modules transformed.
dist/index.html                  0.50 kB │ gzip:  0.30 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.67 kB
dist/assets/index-DIRflXaC.js   81.97 kB │ gzip: 29.29 kB
✓ built in 131ms
yarn build  0.61s user 0.29s system 135% cpu 0.663 total

› time yarn build
rolldown-vite v6.3.18 building for production...
✓ 441 modules transformed.
dist/index.html                  0.50 kB │ gzip:  0.30 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.67 kB
dist/assets/index-DIRflXaC.js   81.97 kB │ gzip: 29.29 kB
✓ built in 132ms
yarn build  0.60s user 0.28s system 133% cpu 0.662 total

› time yarn build
rolldown-vite v6.3.18 building for production...
✓ 441 modules transformed.
dist/index.html                  0.50 kB │ gzip:  0.30 kB
dist/assets/index-QWt4X0jk.css   8.21 kB │ gzip:  1.67 kB
dist/assets/index-DIRflXaC.js   81.97 kB │ gzip: 29.29 kB
✓ built in 129ms
yarn build  0.59s user 0.27s system 131% cpu 0.657 total

Steps to reproduce

time yarn build (which is alias for vite build)

System Info

System:
    OS: macOS 15.5
    CPU: (12) arm64 Apple M3 Pro
    Memory: 214.84 MB / 18.00 GB
    Shell: 5.9 - /opt/homebrew/bin/zsh
  Binaries:
    Node: 23.10.0 - ~/.asdf/installs/nodejs/23.10.0/bin/node
    Yarn: 4.9.1 - ~/.asdf/installs/nodejs/23.10.0/bin/yarn
    npm: 10.9.2 - ~/.asdf/plugins/nodejs/shims/npm
    bun: 1.2.15 - /opt/homebrew/bin/bun
  Browsers:
    Safari: 18.5
  npmPackages:
    vite: ^6.3.5 => 6.3.5

Used Package Manager

yarn

Logs

No response

Validations

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions