[merge] readv for the smart server

Robert Collins robertc at robertcollins.net
Mon Sep 18 00:05:57 BST 2006


On Fri, 2006-09-15 at 23:19 -0500, John Arbash Meinel wrote:
> Attached is a patch which adds readv() support for the smart server
> protocol.
> 
> It isn't very tricky. The protocol basically just calls 'readv', and
> passes as text a newline separated list of comma separated
> 'start,length' pairs.
> The server then calls _base_transport.readv() and returns the raw data
> bytes. Originally, I was thinking to chunk up all of the bytes, but the
> code doesn't really support multiple chunks all that well, since each
> chunk would have to end with 'done\n'.
> 
> We *could* do a little bit more for integrity, etc. But this works, and
> should perform well.
> 
> Over the loopback, this provides very little benefit. But in general, it
> has the same performance (within a second or so). There is a little more
> work for both sides, because they have to serialize and deserialize the
> readv request.
> 
> However, over a 35ms latency, 160KB/s connection, this changes the time
> for updating from revno 2000 => 2017 from 3m10s down to 38s. So quite a
> big drop. For comparison, http 38s takes and sftp takes 51s. To do the
> same pull.
> 
> So, it would seem that we have a protocol comparable to http on our hands :)
> 
> Also, just to give some general performance information push is faster
> than sftp too. It does this because of a lot fewer round trips per
> operation. This connection has a 30KB/s upload cap. To push from 2000 =>
> 2017 takes 1m2s (The new code doesn't change this). Over 'sftp' it takes
> 1m24s.
> 
> I have another branch where I'm implementing 'put_bytes_non_atomic'.
> Which should save us a bunch more time when pushing a new branch.

I'm glad its been implemented, but I think the code can use some
tightening up - as its your weekend, and I'm freezing the branch today,
heres a review that does its recommendations, rather than just a review.


-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smart-transport-readv.patch
Type: text/x-patch
Size: 11140 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060918/1a46ff44/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060918/1a46ff44/attachment.pgp 


More information about the bazaar mailing list