I am embedding Lua in a programm for no-eabi device with 16Mhz 32-bit ARM7TDMI processor and 256Kb RAM (yes, that's GBA). Currently it's working flawlessly (thank you, StackOveflow users, for answering my questions), doing easy tasks, but what optimizations I can do to perform overall efficiency? Here's some of my thoughts:
Currently I am storing my Lua code as constant char array (there's separate ROM up to 32Mb, so it helps to free RAM). When I want to run it I just push this string to Lua stack and "pcall" it. But as I know, Lua builds that code into byte-code in RAM. I thoght that can be some problems with big Lua files too. Any way-to precompile that byte-code and save it to constant container too?
Which asm command set is better for running Lua - THUMB or ARM?
EDIT: Maybe, changing vanilla Lua to LuaJIT? As I know, LuaJIT has many assembly lines of code (which makes it less portable), any chance to perform successful build to old ARM7 processors?