rollup / rollup/rollup

How do you debug potential performance issues beyond the documented `--perf` flag?

Open
#4,978 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

t² 📚 documentation t⁸ ⋅ triage
Dominant language
JavaScript
Stars
26.3k
Forks
1.8k
Avg merge
2d 11h
Merged PRs (30d)
20

Description

Documentation is
  • Missing
  • Needed
  • Confusing
  • Not sure?
Please Explain in Detail...

I have this --perf output:

❯ pnpm rollup --config --perf

 → dist...
# ...
# BUILD: 30494ms, 306 MB / 384 MB
## initialize: 62ms, -710 kB / 77.8 MB
- plugin 1 (addon-modules) - buildStart: 60ms, -1.54 MB / 76.9 MB
- plugin 5 (node-resolve) - buildStart: 0ms, 2.53 kB / 76.9 MB
- plugin 4 (babel) - resolveId: 538ms, 40.1 MB / 612 MB
- plugin 6 (ember-externals) - resolveId: 622ms, 1.26 MB / 612 MB
## generate module graph: 30321ms, 295 MB / 373 MB
- plugin 7 (preprocess-glimmer-template-tag) - resolveId: 246ms, 79.3 MB / 612 MB
- plugin 8 (rollup-hbs-plugin) - resolveId: 840ms, 406 MB / 612 MB
- plugin 9 (copy-assets) - resolveId: 875ms, 427 MB / 612 MB
- plugin 11 (addon-css-rollup) - resolveId: 444ms, 17.9 MB / 612 MB
- plugin 15 (stdin) - resolveId: 330ms, 15.7 MB / 612 MB
- plugin 5 (node-resolve) - resolveId: 551ms, 283 MB / 612 MB
- plugin 4 (babel) - load: 98ms, 15.4 MB / 505 MB
- plugin 5 (node-resolve) - load: 0ms, 68.2 kB / 505 MB
- plugin 7 (preprocess-glimmer-template-tag) - load: 4ms, 683 kB / 505 MB
- plugin 8 (rollup-hbs-plugin) - load: 11ms, 975 kB / 505 MB
- plugin 11 (addon-css-rollup) - load: 1ms, 242 kB / 505 MB
- plugin 15 (stdin) - load: 0ms, 40.8 kB / 505 MB
- plugin 0 (json) - transform: 1ms, 144 kB / 506 MB
- plugin 4 (babel) - transform: 22ms, 12.1 MB / 506 MB
- plugin 10 (addon-rewritecss-rollup) - transform: 3ms, 823 kB / 509 MB
- plugin 11 (addon-css-rollup) - transform: 2ms, 341 kB / 509 MB
- plugin 12 (addon-js-unplugin) - transform: 2ms, 291 kB / 509 MB
- plugin 13 (addon-hbs-rollup) - transform: 1ms, 352 kB / 509 MB
generate ast: 87ms, -4.97 MB / 509 MB
analyze ast: 96ms, 6.31 MB / 509 MB
## sort and bind modules: 16ms, 7.6 MB / 380 MB
## mark included statements: 94ms, 3.63 MB / 384 MB
treeshaking pass 1: 31ms, 4.67 MB / 385 MB
treeshaking pass 2: 41ms, -1.11 MB / 384 MB
treeshaking pass 3: 7ms, 10.7 MB / 395 MB
treeshaking pass 4: 5ms, -8.49 MB / 386 MB
treeshaking pass 5: 4ms, 6.91 MB / 393 MB
treeshaking pass 6: 4ms, -9.43 MB / 384 MB
# GENERATE: 125ms, 20.4 MB / 405 MB
## initialize render: 0ms, 4.12 kB / 384 MB
## generate chunks: 7ms, 5.94 MB / 390 MB
## render chunks: 35ms, 1.03 MB / 391 MB
## transform chunks: 39ms, 12.7 MB / 404 MB
sourcemaps: 30ms, 3.26 MB / 406 MB
## generate bundle: 43ms, 439 kB / 405 MB
- plugin 2 (public-assets-bundler) - generateBundle: 4ms, 760 kB / 405 MB
- plugin 3 (app-reexports) - generateBundle: 5ms, -4.76 MB / 400 MB
- plugin 5 (node-resolve) - generateBundle: 0ms, 352 B / 400 MB
- plugin 9 (copy-assets) - generateBundle: 5ms, 1.07 MB / 401 MB
- plugin 11 (addon-css-rollup) - generateBundle: 1ms, 191 kB / 402 MB
- plugin 14 (delete) - generateBundle: 0ms, 8.62 kB / 402 MB
# WRITE: 29ms, 2.41 MB / 407 MB

most of the time is spent in the generation of the module graph

## generate module graph: 30321ms

but the output doesn't say what could be responsible for this much time.
Where is all the time going, and how do I find out?

I've done a --cpu-prof with node, and it seems most time is spent resolveing -- but I'd like to know from what and why.

Your Proposal for Changes

Could more instrumentation be added to --perf?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the --perf entry point and the existing generate module graph and resolve timings; compare them with the Node --cpu-prof results. Define the added instrumentation so it identifies which resolution work consumes module-graph time, and verify that the output answers where and why time is spent.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.