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
Code:
After upgrading to typescript 3.1.3, our application has been building for a very long time. The total time has increased tenfold. By profiling the build, I found the reason for the slowdown in performance.
Reacted by Alexander Dukhnovskiy, Vladimir, George Borzilov, Anton Dosov, Максим, Vostroknutov Vitaliy, Максим Иванов, Andrey Kotofotoff, Elvis Begovic, Maxime and 11 more
Looking at that code again, I don't know how it could cause a noticeable slowdown. That would probably require thousands or millions of files in your program.
How are you running tsc to hit that path of the code? tsc -w or some custom build tool?
How many files are in your program? You can find out using --diagnostics flag of tsc.
After investigating further, it turns out this code may be executed for each import (or type reference directive) in every file of the project (depending on the kind of change).
I have a fix up in #28028 to avoid iterating every file.
Reacted by Reactive Fox, Vostroknutov Vitaliy, Nicholas Jamieson, xiaodeaux, hsrobbv, Eugene Lubarsky and Andrew Gerst
Reacted by xiaodeaux, PaoloB, hsrobbv, Jonas Frost and Andrew Gerst
Pinging again. It's not obvious how to apply the contents of 3.1.6 source on top of the installer linked above. Is it just a matter of copying over and overriding tsc.js+tsc.exe? Is there anything else that needs to be copied over? At the very least, I'd like to hear from one of the devs that it won't break anything. A diff of tsc.js between the two version really lights up because the source contains comments.
Activity
ajafff commentedon Oct 21, 2018
Looking at that code again, I don't know how it could cause a noticeable slowdown. That would probably require thousands or millions of files in your program.
How are you running tsc to hit that path of the code?
tsc -wor some custom build tool?How many files are in your program? You can find out using
--diagnosticsflag oftsc.thekiba commentedon Oct 21, 2018
The count of files in the project ~10k.
I am using @angular/cli. And I tried to set the
compilerOptions.diagnosticsflag intsconfig.json, but I don't receive any information.Fix performance regression when reusing old state
ajafff commentedon Oct 21, 2018
After investigating further, it turns out this code may be executed for each import (or type reference directive) in every file of the project (depending on the kind of change).
I have a fix up in #28028 to avoid iterating every file.
thekiba commentedon Oct 21, 2018
I build typescript from your pull request, and used it to build my application. Now the build time is the same as before.
👍Thanks for the quick response.
zorrme commentedon Oct 26, 2018
Can we release this please ?
Fix performance regression when reusing old state
DanielRosenwasser commentedon Nov 1, 2018
This should be available in TypeScript 3.1.6. Thanks Klaus Meinhardt (@ajafff)!
Manish3177 commentedon Nov 5, 2018
Could we get updated VS installer for 3.1.6: https://www.microsoft.com/en-us/download/details.aspx?id=55258?
Manish3177 commentedon Nov 16, 2018
Pinging again. It's not obvious how to apply the contents of 3.1.6 source on top of the installer linked above. Is it just a matter of copying over and overriding tsc.js+tsc.exe? Is there anything else that needs to be copied over? At the very least, I'd like to hear from one of the devs that it won't break anything. A diff of tsc.js between the two version really lights up because the source contains comments.