[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] LuaJIT-2.0.0-beta8
- From: Josh Haberman <jhaberman@...>
- Date: Thu, 23 Jun 2011 18:08:23 +0000 (UTC)
Mike Pall <mikelu-1106 <at> mike.de> writes:
> Bytecode loading/saving
> -----------------------
>
> A corporate sponsor who wishes to remain anonymous has sponsored
> the work on bytecode loading/saving.
This is very cool Mike.
I noticed that your varint encoding uses continuation bits
(protocol buffers do this also). You can achieve the same
bit density by putting all the continuation bits in the first
byte instead. For example, instead of:
1aaa aaaa 1bbb bbbb 0ccc cccc
do:
110a aaaa aabb bbbb bccc cccc
The latter encoding has the following advantages:
1. you don't have to branch on every byte.
2. you don't have to transform the value with shifts,
you're just adding or masking away high bits.
The latter encoding has been benchmarked to be up to
40% faster. In hindsight Protocol Buffers would probably
choose the latter encoding today.
Best,
Josh