4 ms·
> it's not like the JS is being AOT compiled via Zig or Rust That would actually be slower than what you get from a JIT compiler.
by kaba0 3y ago
> it's not like the JS is being AOT compiled via Zig or Rust
That would actually be slower than what you get from a JIT compiler.
- satvikpendem 3y agoI meant the compiler written in a lower level language that then binds to LLVM, as Rust is currently. Why would AOT be slower than JIT?
- zamalek 3y agoIn theory it could be: compiling for the specific latency profile and instruction-set of each individual machine. In practice that has never been done.
- kaba0 3y agoWhy would the implementation language matter for the compiler? It is a traditional input-output algorithm, it is either good and does many fancy optimizations for good output, or it isn’t. Sure, the speed of compilation may vary, but that’s a different question. Also, JS being such a dynamic language, it will likely perform better with a speculative JIT compiler, e.g. a shape can be assumed for a frequently used object. This is only possible with PGO to a degree.