Bugzilla – Bug 9903
Precompile lua code using luac for faster boot times
Last modified: 2010-05-06 15:47:32 UTC
I experimented with compiling all lua code on a controller with luac (using a bit of a hack described below). I found that there could be around a 3 seconds improvement of boot time using luac. This was compared with 2 different controllers (1 was 1 second slower, the other was 3 seconds slower) full start time: luac version: 18s to splash screen 35s to splash screen gone luac had some problems running on the controller, and working with Richard, I patched lua to make the luac work successfully (though the underlying issue might be in how we are cross-compiling, not a flaw in lua source): lua-5.1.1/src/lundump.c 134a137,139 > case 254: > setivalue(o,LoadInteger(S)); > break; Without that change, luac itself compiles without apparent error, but when run with luac -l or with jive it errors out with error: - bad constant in precompiled chunk With the change I was able to successfully compile and run all lua code with the following command to compile all lua source (using poky's arm version of luac copied to a memory card on the controller): cd /usr/share/jive find . -type f -name "*.lua" -exec /mnt/mmc/luac -o {} {} \;
Tom is no longer available to us