-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to investigate rollup performance issues in order to locate+report a bug #4295
Comments
You can create a custom plugin to provide module level timing granularity of events (or whatever information you want) and insert it into the plugin list to indirectly debug other plugins:
Here's an example plugin to debug with no knowledge of the spy plugin above:
Just place the spy plugin before and after the suspected problematic plugin using different tags to differentiate them. I happen to be using the CLI, but you could integrate it into a rollup config file just as easily:
From the timings in the log you can infer that |
Great, I will file appropriate bugs once I figure out what's going on - one of them is definitely dts so that's not rollup's fault, but removing dts didn't make the other issue go away. Do you want a PR that expands the information for --perf, or would you prefer to leave that out of the docs? |
I just wanted to post an update: The time is all being spent in typescript, which explains why for one file it was in dts (since that is generating .d.ts files from my typescript) but in the other it wasn't in a third-party plugin. Oddly it is not being reported as under the rollup typescript plugin, so I'll file a report about that reporting issue. I was able to get a CPU profile out of tsc and reproduce it there, then view the profile in chromium - it might be cool to document how to get a cpu profile out of rollup if possible, because it is very easy to open one of those in chrome devtools and look at the callstacks to figure out where time is going. |
Did you use 'ts.CompilerHost'? |
Pretty much default typescript settings, just |
Documentation is
Please Explain in Detail...
I'm trying to investigate a regression with rollup in my build pipeline where some changes to my JS have caused rollup build times to increase from ~5 seconds to ~78 (!) seconds. I eventually found
--perf
and once I got it working was able to use that to verify some of my measurements. Unfortunately, the timing data seems unreliable and also quite coarse-grained - for one file the BUILD timing lists 75320ms but none of the sub-items last more than a few hundred msec, so the rest of that time is just... not recorded. For the other file the time is reported but all under one plugin (dts - transform
whatever that is - I didn't configure rollup, I'm just troubleshooting).At present based on the information I have it's not clear to me where this issue should be reported, and the data I'm getting isn't precise/accurate enough for me to try and narrow down the cause or reduce it to a small reproduction case.
Your Proposal for Changes
Please expand on your issue template to describe what developers like me should do when looking to report a performance issue, and if possible provide a bit more info in the docs on how to use
--perf
to do so. It took a good amount of searching and experimenting to even figure out how to get timings - I only knew it was possible because I saw timings in an old report about a similar performance issue.The text was updated successfully, but these errors were encountered: