[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Locking Table Member Additions
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 18 Jun 2014 08:42:26 -0300
> Actually that is quite easy by just creating a table of numbers:
>
> return {1,2,3,4,5,6,7,8,9,0,1,6,3,2,2,2,4,6,7,2,7,8,3}
>
> As Lua bytecode stores all numbers as doubles (by default) the source
> code will be smaller as long as the numbers have less then 8 digits.
This example works specially well because the Lua compiler performs
constant optimizations and so stores only one copy of each constant
in the bytecode.
Another source of size in precompiled scripts is debug information,
specially line numbers, which are stored as an array of ints, one for
each instruction. Stripping precompiled scripts with luac -s removes
this information and more.
- References:
- Locking Table Member Additions, Leinen, Rick
- RE: Locking Table Member Additions, Leinen, Rick
- Re: Locking Table Member Additions, Sean Conner
- Re: Locking Table Member Additions, Tom N Harris
- RE: Locking Table Member Additions, Leinen, Rick
- Re: Locking Table Member Additions, Sean Conner
- Re: Locking Table Member Additions, Paige DePol
- Re: Locking Table Member Additions, Thomas Jericke