Comment by bastawhiz

Comment by bastawhiz 9 hours ago

0 replies

It's unclear whether you could build a JIT that meaningfully benefits from typescript types.

1. Hidden classes can't be created from TS interfaces because they don't represent the full data of the underlying object

2. You don't really ever want to compile code the first time you see it, because that takes a lot of memory and extra CPU cycles. By the time code has run enough to be worth compiling, you probably have enough profile data to optimize better than you could with data from the types anyway.

3. Many of the juiciest optimizations come from types that aren't representable in TS, like integers.

4. Including all the types for all your code and deps (literally all the .d.ts) is huge, and the size increase alone might nullify any performance benefit.