[MERGE][1.7] Trivial fix for sftp readv
John Arbash Meinel
john at arbash-meinel.com
Thu Sep 4 21:43:10 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote:
> John Arbash Meinel wrote:
>> Anyway, with this patch, 'bzr branch sftp://localhost/...' drops from 37s =>
>> ~30s. And I imagine it is even better when dealing with bigger branches.
>
> It it possible that this fixes
> https://bugs.launchpad.net/bzr/+bug/182469 ?
>
> Aaron
I updated the bug with a note about it. It certainly could. I believe
the current code should bloat reads by about 5:1. (It does ''.join()
which has to have room for one complete copy, and it should also need a
4-byte pointer for every character, which is another 4x for a total of
5x memory.)
The current code can easily hit 2x-3x memory (''.join([buffer]) followed
by breaking that up into smaller strings. I suppose I could actually
destroy the list after doing ''.join() which should cap it around 2x
memory. (goes up to 2x, list is destroyed => 1x, split into smaller
chunks => 2x).
And if that didn't actually fix it, then the chunked_sftp patch I wrote
should probably finish the job.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkjASF4ACgkQJdeBCYSNAAP4/ACfVPl8KvfkiUruTk1MomyBj4Pz
FA4An09VMu9bW+3AQRR3iMK0J873r2Bh
=U1RV
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list