[MERGE] BEncode Revision Serializer

Andrew Bennetts andrew.bennetts at canonical.com
Thu Jun 4 03:04:48 BST 2009


John Arbash Meinel wrote:
[...]
> > I didn't test RIO for this, though I think I would like to. On my simple
> > tests, it was actually considerably faster than XML or Bencode, which
> > surprised me.
> 
> 
> I did end up checking with the RIO code that Jelmer proposed earlier.
> 
> dev7-rio 0.93 sec per loop
> 
> So it is quite a bit faster than bencode and xml. Which surprises me a
> bit, but perhaps it is all the strtol() overhead of bencode.

I wonder if a custom variation on bencode would help here, one that
serialised numbers in base-16 (hex) rather than base-10?  It would also make
the raw text size a little bit more compact, although still not as slim as a
format with no length prefixes.  I'm not very keen to depart from a
standard, but if it's a significant win...

(We could call it “bzrencode”?)

[...]
> I'll also note that both rio and bencode would probably benefit the most
> from a directly tuned pyrexRevision deserializer, rather than going
> through the intermediate representation. (Consider that at a minimum, we
> can avoid a malloc per attribute, because we don't have to create a
> PyString for the 'key'.)

Right.  This wouldn't be too hard to code up, I suspect.

-Andrew.



More information about the bazaar mailing list