Reputation: 4872
Since browsers are implementing all the features which typescript also has, does changing the compilation target from es5 to es6 (or whatever is the closest to what typescript currently supports) reduce the compilation time of typescript files?
Which compilation step is taking the most of time for typescript?
Can we turn off the compilers type checker since we are running a language server anyways which does the checks (and compiler sometimes misses errors anyways)?
Upvotes: 5
Views: 905
Reputation: 11182
I just experimented a little on this by compiling a medium-sized TypeScript project of mine with different targets. These results represents the average time of 20 builds per target (TypeScript version 3.4.2)
+--------+----------+
| Target | Duration |
+--------+----------+
| es3 | 10207ms |
| es5 | 9103ms |
| es6 | 8122ms |
| es2015 | 7991ms |
| es2016 | 7988ms |
| es2017 | 7966ms |
+--------+----------+
So it appears you are correct and there are performance improvements from switching to a newer target, but the improvements seem to be quite insignificant from es2015.
Upvotes: 4