4 ms·
There's an answer from TypeScript team for your question :) https://twitter.com/drosenwasser/status/1260723846534979584 https://twitter.com/drosenwasser/status/
by harrygeez 3y ago
There's an answer from TypeScript team for your question :)
https://twitter.com/drosenwasser/status/1260723846534979584 https://twitter.com/drosenwasser/status/1260723846534979584
Basically,
> Let's say TypeScript takes over 20 seconds to type-check a medium-sized program. That's not usually because it's JS, it's often because of types that cause a combinatorial explosion.
Also
> A different runtime can afford a lot (it sounds like parallelism and start-up time in this case) but I haven't seen a CPU-bound benchmark that supports the idea of a 20x all-up speed-up.
- rtpg 3y agoI mean I get what Daniel's saying, but I kinda doubt there wouldn't be _some_ speedup. And hey, what if type checking for small programs went from half a second to 100 ms? That would be nice!
- foldr 3y agoThat's a five times speedup. I wouldn't expect a typical 'compiled' language to run five times faster than JavaScript on the kind of code you find in a compiler.
- ComputerGuru 3y agoYou are excluding startup time. Loading the interpreter/runtime and initial JIT pass is slow. For many codebases, the compilation time is actually dominated by the time it takes the interpreter to get going.
- deleted 3y ago[deleted]
- sdflhasjd 3y agoBoth swc and esbuild claim to be much faster typescript compilers in part because they're written natively, but are actually just "cheating" and not doing any type-checking at all. That's not to say they're useless though, they're good for fast hot-reload as you can have type-checking running in parallel.
- madeofpalk 3y agoit's easy to write a typed language compiler if you don't need to actually check types :)