lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Oct 14, 2010 at 10:46 AM, KHMan <keinhong@gmail.com> wrote:
> On 10/13/2010 10:34 AM, David Manura wrote:
>> Another area of difficulty involves a function that reverses the order
>> of bits [5]....
>
> Do you have timing data on the relative cost of building the Huffman trees?
> Should check it before deciding on whether to optimize this. It is called up
> to only ~300 times for both tables and this is done once per block of max
> 64KB of data. In any case, this one is restricted to the lengths of the
> Huffman code, 1-15 bits, as stated in the source code.

It is fairly minor.  The bit reverse is called only 322 times when
decompressing the ~200KB lua-5.1.4.tar.gz.

The more time consuming places seem to deal with the small loops of
reading/writing bits from the stream.