
TL;DR
A performance issue in LuaJIT, the just-in-time compiler for Lua, can drastically affect execution speed due to 'Not Yet Implemented' (NYI) operations. A specific NYI caused a 20× difference in iteration counts during benchmarking.
✦ Why It Matters
Review your LuaJIT code for potential NYI operations to avoid performance degradation.
Key Takeaways
How It Works
LuaJIT uses a tracing JIT compilation approach, recording execution paths to optimize performance. However, certain operations like 'unpack' trigger a fallback mechanism that can lead to blacklisting functions, causing significant slowdowns.
By generating specialized wrappers that directly access function arguments, the need for 'unpack' is eliminated, allowing the JIT compiler to maintain optimized execution.
Related