I know somewhat useless, but measuring more shows that creating the abstract syntax tree (AST) of that code below alone is 4ms in tsc, which is 10 thousand times slower than the new type checking. The new solution doesn't even need an AST, only once for generating the bytecode.
New type-checker architecture seems promising. Following code:
- TypeScript using the Compiler API: 6ms
- new type checker cold start: 0.007ms
- warm start (bytecode cached e.g. on disk): 0.0004ms
that's 15.000 times faster