-
Notifications
You must be signed in to change notification settings - Fork 181
Compilation time 4x slower after upgrading Typescript from 2.5.3 to 2.6.1 #517
Comments
You could use TS-loader instead awesome-typescript-loader |
@cmargulhano After reading about thread-loader I do not see how thread-loader can be used instead of awesome-typescript-loader. Did you perhaps mean 'add in front of'? Something is going wrong somewhere that leads to a 4-times increase of compilation time. My first impression is that adding worker pools is not the right solution for fixing the cause of the issue. That feels like adding a tow-truck to improve my cars speed when it runs out of gas... As a side note: According to issue #497, thread-loader only shaves approx 20% extra of compilation time (in that use case) after switching from awesome-typescript-loader to ts-loader. |
Sorry, I meant TS-loader as mentioned in issue #497 |
As mentioned in the issue, I already compared |
In my case, this solves the performance issues. I also update the webpack versions. My build time decreased from 4 minutes to 40 seconds. |
We have the same issue and the problem is really funny. it's intersections of three bugs :)
So typescript doesn't get file text and thing that the file are missing. After building it trys to find all missing files (file added to cache but without parsing)
therefore it can not reuse cache because (it finds this files on file system)
So @s-panferov is it possible to remove check on empty file? |
@denisnikolayev awesome! Thanks for the investigation. I'll make a fix. "they have three empty d.ts files" 🤦♂️ |
Uhhh... so what has upgrading from Typescript 2.5.3 to 2.6.1 got to do with this? Does Typescript handle empty d.ts files differently as of Typescript 2.6.1? |
@pamtbaau have no idea. maybe they improved validation of project structure. if file didn't exist before that means structure was changed and we have to rebuild everything @s-panferov np.
it seems like it can increase speed a lot. |
Please try |
Compilation time from ~4 minutes down to ~50 seconds (app uses Angular/rxjs). I'm happy with awesome-typescript-loader again... |
Compilation time: 196.2 seconds
Compilation time: 27.3 seconds
|
👍 works great! |
@denisnikolayev thank you again for you investigation. It was really helpful! |
I've been struggling with build times of my app since TS2.6.1 as well, and hadn't been able to pin it on anything - this dramatically reduced my build times - many thanks! |
I upgraded |
After upgrading Typescript from 2.5.3 to 2.61 compilation time went up from 1min to 4min. Downgrading TS and upgrading again confirmed the difference in compilation time.
As a side note: ts-loader does not seem to be impacted by Typescript upgrade.
os: Windows 10
webpack: 3.8.1
awesome-typescript-loader: 3.2.3
The text was updated successfully, but these errors were encountered: