3 ms·
One big factor is that LuaJIT has a really fast non-jitting interpreter. There is some overhead on JIT compilation so its best to avoid it unless you really are
by ufo 11y ago
One big factor is that LuaJIT has a really fast non-jitting interpreter. There is some overhead on JIT compilation so its best to avoid it unless you really are in a hot loop.
On the other hand, in Javascript the language semantics is branchier and overall more complicated so its hard to write a fast base interpreter. The system relies much more on the JIT compilation, which also means that Javascript JITs have evolved to be much more complex than LuaJIT's JIT. LuaJIT bets all its chips on pure tracing compilation while Javascript JITs tend to go for more hybrid strategies nowadays.