[MERGE] Reduce the number of round trips required to create a repository over the network.

Robert Collins robert.collins at canonical.com
Thu Feb 19 22:04:15 GMT 2009


On Thu, 2009-02-19 at 08:45 -0600, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> > This includes a couple of separate branches so I couldn't get a good
> > bundle out of it :)
> > 
> > However they are small, so it shouldn't be an issue.
> > 
> > Anyhow, with this, initial push of a trivial branch to a bzr+ssh server
> > is now 75-100 round trips. Andrew and I should get the stream code
> > integrated into our branch tomorrow, where we can see how much that
> > reduces it (and it will certainly reduce the number of RPC calls for
> > non-trivial branches, which is a *much* more interesting use case).
> > 
> > -Rob
> > 
> 
> As mentioned earlier, I'm not fully sold on "network_name()", though I
> certainly wouldn't block this sort of improvement on that.
..
> Would it be possible to just factor the "initialize" function into
> several helpers? Like "_initialize_via_rpc", etc?

Yup, will do.

> I also had a question. Once you initialize() the remote repository, do
> you get something back that you can work with? Or do you have to go
> through the "Repository.open()" song and dance.

We get back an object we can work with immediately - the rich
root/subtrees/external-refs flags and the network_name give us enough to
work with.

> And one other way to decrease the number of round trips... initialize()
> should return a write-locked repository. I don't think we want to invent
> yet-another RPC for it. So for compatibility, perhaps the RPC could
> return a write-locked one, which is then unlocked in the calling code.

Pack repositories don't write lock any more except when updating the
names list. So this is entirely unneeded. It may be needed for Branch,
but thats a separate discussion. (And I lean towards making a new RPC
when the time is right rather than having an RPC that does not fit well
today, and which we end up fighting with all the time until a
refactoring finally happens).

-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090220/5cff2349/attachment.pgp 


More information about the bazaar mailing list