Why is LuaJIT so good?

EDIT: Unfortunately, LuaJIT has been inferred from comparison in the link below.

This comparison of programming languages ​​shows that LuaJIT has more than a ten-fold improvement over the usual Lua implementation. Why is the change so great? Is there anything specific in Lua that makes it useful for compiling JIT? Python is dynamically typed and compiled into bytecode, so why does PyPy (which I think is JIT) show such a big performance jump?

+46
lua jit luajit
Feb 06 2018-11-11T00:
source share
1 answer

Mike Pall talked about this in several places:

As with every performer system, the answer ultimately comes down to two things: algorithms and engineering. LuaJIT uses advanced compilation methods and also has a very finely designed implementation. For example, when fancy compilation methods cannot process a piece of code, LuaJIT returns to a very fast interpreter written in x86 assembly.

LuaJIT gets double points in technical terms because LuaJIT is not only well designed, but Lua itself has a simpler and more consistent design than Python and JavaScript. This makes it (slightly) easier to implement in order to provide consistently good performance.

+54
Feb 06 2018-11-11T00:
source share



All Articles