[RFC] Pyrex implementation for bencode

Martin Pool mbp at sourcefrog.net
Sun Aug 5 23:33:25 BST 2007


I haven't read the code in detail but it looks basically reasonable.

The new source files should have copyright/licence headers - the
standard one for things you added, and for reused files something
indicating how they can be redistributed.

It would be good to make sure the bencode tests run on both the C and
Pyrex implementations.  I have some split-out tests already.

We may not be using bencode enough for this to show up in
macrobenchmarks, but it would be good to have one object serialization
format that's as fast as we can make it, and this is probably a good
choice.  You can include a wider range of objects than rio without
doing adhoc quoting.  I'd hope this would make it less common for
people to do ad hoc quoting or serialization - though particular core
formats might still want to.

> If you think that my work have sense to include in bzr.dev I will start to adapt
> these sources for bzrlib. Also I need some hints about writing proper benchmark
> for my implementation in bzrlib style.

Well, basically they are just unittest tests, except that for the core
operation you want to time (ignoring the setup steps), you do
self.time(callable, *args).


-- 
Martin



More information about the bazaar mailing list