You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: This only happens when a feature in the TypeScript compiler is triggered that offers special handling for identical source files. In our case, we see this due to particular combinations of dependencies at certain versions.
I originally saw this in a proprietary monorepo where, upon switching from TypeScript 2.9.2 to 3.0.1, individual packages were taking up to 25 minutes (each) to build with rollup and rollup-plugin-typescript2. After investigating, I believe typescript is the party not working as intended here, rather than rollup or the plugin. I think rollup is just hitting a particular performance regression over and over again, in a way that tsc wouldn't.
Expected behavior:
I expect the performance to be similar to that of 2.9.2.
In terms of what I've seen debugging the code: I expect tryReuseStructureFromOldProgram() to indicate that the program can be reused within rollup after it is first initialized.
Actual behavior:
In codebases where this is triggered, the performance of rollup is approximately 5-10 times worse than 2.9.2.
I see tryReuseStructureFromOldProgram() always indicating that the program cannot be reused due to this check looking at the redirectInfo for the source files. At the point of failure, some of the relevant values are:
TypeScript Version: 3.0.1 through 3.1.0-dev.20180918
This bug does not manifest in TypeScript 2.9.2.
Search Terms:
Rollup slow performance perf
Program structure reuse
redirectInfo
Code
A repo reproducing the problem: https://github.com/AlexLandau/ts3-rollup-perf-bug
Note: This only happens when a feature in the TypeScript compiler is triggered that offers special handling for identical source files. In our case, we see this due to particular combinations of dependencies at certain versions.
I originally saw this in a proprietary monorepo where, upon switching from TypeScript 2.9.2 to 3.0.1, individual packages were taking up to 25 minutes (each) to build with rollup and rollup-plugin-typescript2. After investigating, I believe typescript is the party not working as intended here, rather than rollup or the plugin. I think rollup is just hitting a particular performance regression over and over again, in a way that tsc wouldn't.
Expected behavior:
I expect the performance to be similar to that of 2.9.2.
In terms of what I've seen debugging the code: I expect tryReuseStructureFromOldProgram() to indicate that the program can be reused within rollup after it is first initialized.
Actual behavior:
In codebases where this is triggered, the performance of rollup is approximately 5-10 times worse than 2.9.2.
I see tryReuseStructureFromOldProgram() always indicating that the program cannot be reused due to this check looking at the redirectInfo for the source files. At the point of failure, some of the relevant values are:
Playground Link: N/A
Related Issues:
This PR introduced the redirectInfo construct in play here: #16274
The text was updated successfully, but these errors were encountered: