Execution time of Lua script in Defold is VERY high compared to execution through terminal

It looks like it is the jit compilation which messes with the execution of that loop. Disable jit compilation and it is as fast as you’d expect:

if jit then jit.off() end
run_loop()
if jit then jit.on() end
4 Likes