Description
Running 10000000 loops in a Lua module script using LuaJIT 2.1.0-beta3 in the terminal gives 10.62 seconds.
Using the same module in Defold by requiring the same module gives execution time of 3 minutes.
Can we know what is causing this and if there is any way we can get around this? This is very crucial for our project and we would appreciate any effort from anyone answering this question.
To Reproduce
Steps to reproduce the behavior:
- Make a Lua module with following script:
local M = {}
local function run_loop()
for i = 1, 10000000 do
print(i)
end
end
run_loop()
return M
- Run it in terminal using “luajit .lua” and evaluate time taken.
- Require same Lua module in main.script in an empty Mobile Game template Defold project and evaluate again.
Defold version:
- Version : 1.6.2
Platforms:
- Platforms: macOS, Android
- OS: MacOS 13.3.1, AndroidOS
- Device: MacBook Air M1, Any Android Device