6 ms·
I still find the Typescript compilation time to be annoying. I rediscovered using Typescript for backend development on NodeJs and was very unpleasantly surpris
by bengalister 6y ago
I still find the Typescript compilation time to be annoying. I rediscovered using Typescript for backend development on NodeJs and was very unpleasantly surprised by the compilation time (my only complaint).
For a project with 20-30 files and around 8 dependencies, it took 10-20 seconds to compile and 4Gb of RAM (yes I checked with tsc --listFiles that no other files were parsed).
The same in Go to compile to native would probably take <5s in my experience!
- piazz 6y agoSuper agree. Speedy compilation time of Go was my favorite feature. TS compilation is frustratingly heavy.
- smt88 6y ago> or a project with 20-30 files and around 8 dependencies, it took 10-20 seconds to compile Something is very wrong here. If you use `tsc -w`, you should get incremental compilation. Small changes should compile almost instantly. For me, even without using `-w` on pretty large projects, my compile time is never more than 5s. I have to wonder if you have bottlenecks elsewhere. Regardless, TypeScript's type system is much, much more expressive than Go's, so compile time will theoretically be slower. For me, it's worth it because compile time is an inexpensive way to save lots of maintenance time in the future. (Note that I would never use TypeScript and Go for the same type of project, but that's my mindset in theory.)
- qaq 6y agoTypeScript has way more advanced type system so there is a price you pay for that.
- pm90 6y agoIIUC, this is specifically a problem with the TS build system/runtime, not because it’s typed. Deno is attempting to solve that.
- Xavdidtheshadow 6y agoThat's a fair complaint, but I find that during development, I use `tsc --watch`, which makes incremental compilation very fast. Of course, that doesn't affect the slow production build time, but I care a lot less about that (since it usually happens off in CI land somewhere and I'm not sitting waiting for it to happen. So ultimately, this is a non-issue for me.