Bug 9903 - Precompile lua code using luac for faster boot times
: Precompile lua code using luac for faster boot times
Status: ASSIGNED
Product: SB Desktop
Classification: Unclassified
Component: UI
: unspecified
: All Other
: -- normal (vote)
: 8.1.0
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-04 14:04 UTC by Wadzinski Tom
Modified: 2010-05-06 15:47 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wadzinski Tom 2008-11-04 14:04:03 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 {} {} \;
Comment 1 Chris Owens 2010-05-06 15:47:32 UTC
Tom is no longer available to us