I found the author post on Reddit and decide to repost it here because it looks like an interesting project. Original text:
Note that the JIT is a beta feature so it is not production ready.
Is this the same as LuaJIT?
No. LuaJIT is tracing JIT while Tsuki is method JIT. LuaJIT should be faster in every cases on vanilla Lua syntax. The ultimate goal of JIT in Tsuki is to boost performance on extension syntax that will be implemented in the future (yes Tsuki will become a superset of Lua 5.4).
How it is implemented?
What JIT currently does is compile Lua instructions into machine code with Cranelift. In other words, it just generate the same code that Rust compiler generate to execute Lua instruction, except it does not read the instruction to execute at runtime. The benefits from this is it eliminate the jump table for the instruction and it known which VM registers to use during compile time. Performance?
On fannkuch-redux benchmark, Tsuki is faster than Lua about 38% on AMD Ryzen 5 5600G and 63% on Apple M1. There are some rooms to optimize this so I expect the performance can be improved in the future.
Neat although I do wish it was a tracing JIT. It should also be noted that the project doesn’t currently support 100% of the Lua 5.4 language (it’s almost there, but there are some differences) so it’s not a complete drop in replacement. It does look like the differences are small enough that most people wouldn’t notice any difference though.


