4 ms·
I hope at some point in time we can use Typescript's type hints to replace/add a better JIT for v8 engine.
by maxpert 7y ago
I hope at some point in time we can use Typescript's type hints to replace/add a better JIT for v8 engine.
- kevinkassimo 7y agoI remember saw something long time ago that type hints does not really offer much performance benefit here. Also TypeScript types aren't that reliable anyways since you can always @ts-ignore them. Real impact of TS on runtime performance is more or less an encouragement to developers to create objects of similar shapes that are easier to optimize. JITs create "shapes" or "hidden classes" anyways: https://v8.dev/blog/fast-properties https://v8.dev/blog/fast-properties . They also do many speculative optimizations.
- domenicd 7y agoMy understanding is that non-sound type systems are not helpful for runtime optimizations. (In fact, to the extent that they operate at runtime at all, they will slow things down, by adding extra checks.) Only sound type systems give you enough guarantees to start doing optimizations with. (TypeScript is not sound.)
- zozbot234 7y agoI'd think V8 itself could be replaced with Cranelift once that gains a few more features.