|
|
|
|
|
by masklinn
2678 days ago
|
|
> Yeah, the JS runtimes are really impressive. I'd be interested to see what a compiler could do with TypeScript though. You can probably just compare AOT and JIT Java or C# implementations and get something of an upper bound. Actual improvements will likely depend on your use case: for short-running programs the overhead of the parsing, JIT machinery & interpretation might dwarf the execution time so even a straightforward compilation full of virtual calls will edge out the pre-JIT interpreter, however for longer-running programs the JIT should be able to devirtualise, inline and optimise the code much better than the AOT compiler will. Inlining is the most important optimisation, and it's hard to AOT inline dynamic dispatch. |
|