[MERGE] BEncode Revision Serializer

John Arbash Meinel john at arbash-meinel.com
Tue Jun 2 02:32:30 BST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


...

>> Given the above, though, it would seem prudent to benchmark both
>> the RIO serializer and the BEncode serializer using UserTest and a
>> bigger dataset (like all of bzr.dev as a baseline, but MySQL would
>> be nice...)
> Is this with both the BEncode revision serializer and the BEncode
> Pyrex patch? I only saw the performance improvements with both.
> 
> Cheers,
> 
> Jelmer

So it seems that *just* having the two patches is not enough, you also
need to change the 'from bzrlib.util.bencode import bencode, bdecode'
lines, etc in bzrlib/chk_seralizer.py

However, even with that change, if I grab the largest revision string I
can find ('sp1r-monty at donna.mysql.com-20000830194457-58362',) 902585
(yes, 902kB for a single revision entry), I get:

100 loops, best of 3: 5.34 msec per loop
versus
100 loops, best of 3: 5.18 msec per loop

For "b.repository._serializer.read_revision_from_string(long_bytes)"

Now, if I take that revision, and then call
"bdecode(rev.properties['file-info'].encode('utf-8')", then I start to
see a difference between python and pyrex:
100 loops, best of 3: 12.6 msec per loop
vs
10 loops, best of 3: 47.2 msec per loop

So I can see that the pyrex version does help for complex bencode
structures, but it would seem that the simple one we have defined
doesn't really stress python's bencode very much. (Since the property is
encoded as a string, it is a single length prefixed read to grab the
whole property, which makes it pretty trivial.)

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkokgS4ACgkQJdeBCYSNAANQmACfapGlf9W4MVMni17UglGJMcEZ
pQgAoLuCDXCfxg8E+vMDVPq3zC7HfV1B
=p68Q
-----END PGP SIGNATURE-----



More information about the bazaar mailing list