[MERGE] BEncode Revision Serializer

Martin Pool martinpool at gmail.com
Thu Jun 4 10:17:34 BST 2009


2009/6/1 John Arbash Meinel <john at arbash-meinel.com>:
> Jelmer Vernooij wrote:
>> Hi John,
>>
> ...
>
>> Is this with both the BEncode revision serializer and the BEncode
>> Pyrex patch? I only saw the performance improvements with both.
>>
>> Cheers,
>>
>> Jelmer
> It is with pt5 of the Pyrex patch, and the BEncode serializer.
>
> I wonder if we could get the space savings back by moving away from the
> Dict and instead using a list of lists. So instead of:
>
> val = {
>  'revision-id': rev.revision_id
> ...
> }
>
> you would have
>
> val = [
>  ('revision-id', rev.revision_id),
> ...
> ]
>
> That way, you can more accurately control the ordering of the values.
>
> Also, I think it should be tested with a lot more history than I tested
> with. I only tested with 1k revs of mysql, so the difference could be
> arbitrary.

For fields that are always present like the revision-id I'd consider
just having a bencode list that stores them in a specified order.
It's a bit less documenting but it will be smaller, faster, and let us
control the order.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list