3 ms·
> maybe there's some technical reason Native code is opaque to the JIT, which means no inlining through native code (inlining being the driver for lots of opti
by masklinn 5y ago
> maybe there's some technical reason
Native code is opaque to the JIT, which means no inlining through native code (inlining being the driver for lots of optimisations) and no specialisation. This means if you have a JIT native code is fine for "leaf" functions but not great for intermediate ones, as it hampers everything.
When ES6 compatibility was first released, the built-in array methods were orders of magnitude slower than hand-rolling pure JS versions.
This issue is one of the things Graal/Truffle attempts to fix, by moving the native code inside the JIT.