Know your engine limitations!

Thank you for the thorough comparison! There’s a couple of important things to know about Lua on mobile:

  1. It’s not allowed to run JIT compiled code on iOS.
  2. We use plain Lua 5.1 on 64-bit ARM CPUs. This is the slow version of Lua (when compared to LuaJIT). This will be somewhat compensated by the powerful CPU on newer iOS devices.
  3. We use LuaJIT with JIT disabled on 32-bit ARM CPUs. LuaJIT is still faster than plain Lua 5.1, even with JIT disabled.

Point #2 can be solved by an upgrade of LuaJIT (this is already in the backlog) but we can’t get around the fact that JIT will be disabled on iOS. This means that it’s important to think about how much code you run each frame and how. It will always be better to let the engine animate things instead of animating using Lua code, and it’s always better to have a single script that updates many game objects (as opposed to one script per game object).

9 Likes