-
Notifications
You must be signed in to change notification settings - Fork 12.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
TypeScript build is slow, compileOnSave/--watch taking ~1minute #22953
Comments
Since you have |
we would like to know more about the regressions you are having.. |
Thanks for the response @sheetalkamat ! So is moving to modules and using webpack probably going to be the best solution to this? We've got over 2700 TS files, so turning everything into modules is going to be a process. Thanks again, |
Thanks for the response @mhegazy , we believe that this is mostly an issue of scale, but we haven't really been able to say 100%. I checked a few of our smaller projects with 10's of typescript files vs. our main projects' thousands, and --watch is fairly reasonable using a single outfile (a few seconds). When I said 'performance issues have been getting rough', I just mean over the past few months of feature development (and adding TS files), the build time seems to be getting worse in a more-than-linear fashion. That could be objectively false (I haven't run any tests), but the general consensus around the office is that a few months ago, compile on save worked fine, and now it's not really usable (and granted, we've added hundreds of ts files since then). In that same time frame, we upgraded to VisualStudio 2017, started using tsconfig's instead of the csproj settings, and then just recently moved away from using MsBuild for Typescript compilation entirely, instead using node_modules/typescript, so there are definitely a number of variables potentially at play. That's why we figured we'd start this thread so we can get a better idea of what we're doing wrong and how we should move forward :) If there's any more info you'd like, please let me know! |
@bforsythe Yes moving away from |
We would like to take a look at your project and see why compile-on-save is taking too long. but as @sheetalkamat noted, the compiler needs to build all files, and concatenate the output in a single string every time you save, and there is less room for optimization there. |
@mhegazy I'll need to run that by my manager, I'll get back to you tomorrow morning. Is there a secure way I can send it? Thanks, |
In my team we're seeing the same thing with initial compilation times take ~1 minute from 6-8 seconds. We had to rollback to 2.7 in order to have acceptable initial compilation times. |
@devuo Can you please share the code to investigate this. We can sign NDA if needed. |
Closing this bug since this was technically question. If anyone running into issues like slow build, please open new bug with detailed logs. Thanks |
Hi all, first I'll say our team has been big TypeScript fans for a while now (pre-2.x)! But unfortunately, performance issues have been getting rough, and some people on the team are starting to feel that the type safety isn't worth the substantial build time increase (perhaps a little hyperbolic, but it's definitely frustrating).
First off, here's the diagnostic output:
And here's our tsconfig.json:
Other things worth noting:
If there's anymore information I can provide, please let me know, or if you have any thoughts or suggestions we can try, I'd love to hear them! The switch to TS has been the number 1 development/debugging time-saving measure we've made since I've been here. But now it feels like those savings are being reclaimed by the build times :(
Thanks for your help,
Brandon
The text was updated successfully, but these errors were encountered: