[PATCH] remote_branch with asyncore

Aaron Bentley aaron.bentley at utoronto.ca
Sat Jun 18 19:42:21 BST 2005


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

Hi all,

I've done a low-hanging-fruit patch that causes RemoteBranch to use
asyncore, but just for one function.

To test, I did "bzr branch http://bazaar-ng.org/bzr/bzr.dev"
The asyncore version performs like so:
real    9m3.351s
user    0m44.616s
sys     0m9.232s

The old version performs like so:
real    14m13.682s
user    0m48.439s
sys     0m7.163s

There's still plenty of room for improvement, because both versions
download each revision and inventory twice; once implicitly, once
explicitly.  The asyncore version does only the explicit downloads
asynchonously.

First, I added effbot.org to the bzr tree.
Then I added double-dispatch, so that RemoteBranch could control the
implementation of multi-id copying.  Then I implemented asyncore
multi-id copying using effbot.org.

Two things were particularly annoying about this approach;
1. Exceptions appear to get swallowed.  At one point, I was wondering
"Why isn't python complaining that I'm trying to call None.close()?"  I
concluded that the value must not be None, but it actually was None.
It's just that the exception was not appearing.

2. effbot automatically ungzips files whether you want it to or not.  I
resorted to monkey-patching the GzipConsumer type out of existence to
work around this.

The nice things were that the api was pretty simple, once I found it,
and it doesn't seem to add huge amounts of code to the tree.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCtGsM0F+nu1YWqI0RAlb6AJ9tHA7ToKJvpWYcqdzILKMV7rWnegCeKkDG
nb9xD06m7nqwkw2daCg3i7E=
=DU06
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: async-multi.patch
Type: text/x-patch
Size: 4106 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050618/18052ee2/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dd-multi-copy.patch
Type: text/x-patch
Size: 1826 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050618/18052ee2/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: effbot.patch
Type: text/x-patch
Size: 17600 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050618/18052ee2/attachment-0002.bin 


More information about the bazaar mailing list