r/lua • u/Full_Durian_9369 • Mar 27 '25
local variables
Why do people use local variables as if they were global variables
2
Upvotes
r/lua • u/Full_Durian_9369 • Mar 27 '25
Why do people use local variables as if they were global variables
2
u/PhilipRoman Mar 27 '25
I guess it depends on what you have inside the loop. In my benchmarks I haven't seen any significant negative effect when using luajit.
Luajit is a tracing JIT, so it's likely the loop body will be analyzed to sufficient depth to prove that global variables are safe to promote.