[MERGE] Use get_parent_map RPC in InterRepo methods

Andrew Bennetts andrew at canonical.com
Wed Sep 24 06:51:18 BST 2008


InterOtherToRemoteRepo delegates most of its work to a “_real_inter”
that uses the _real_repository of the RemoteRepository.  But given that
there is a RemoteRepository instance, it would be more efficient to use
the RemoteRepository's get_parent_map implementation rather than the
_real_repository's one, which generally has to fallback to making many
round trips to lookup even a single key.  The attached patch is a simple
change that arranges for this to happen.

This change on a 500ms latency network saves about 10s out of 61s when
pushing a single new revision to a bzr.dev-sized branch.  (Case 3 at
http://bazaar-vcs.org/SmartPushAnalysis1.8 is the specific test I used).

A further small improvement may be to cache negative results, i.e. that
a certain key does not exist, but that's a bit harder to do correctly
because there are so many ways to change the set of revision keys in a
repository (fetch, copy_content_into, add_revision,
insert_record_stream, direct manipulations of self.revisions...), and
each one of them would need to be updated to invalidate the
negative-lookups cache.  There's some experimentation in this direction
in this bundle's history, but for now I've abandoned that as too much
work for too little pay-off.

Another improvement is to batch get_parent_map queries done by
InterRepo._walk_to_common_revisions to avoid doing one round-trip per
key.  Without this patch it's not such a big deal because the bisection
searches of the index files via readvs tend to cache most of the indexes
relatively quickly, capping the number of round-trips.  With this patch
there's no such self-limiting behaviour, so explicit batching is
required.  A patch to implement this will follow shortly.  With both
patches, I expect much less of the revision graph will end up
transmitted over the network for pushes onto large branches.

-Andrew.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smart-push-experiment-3714.patch
Type: text/x-diff
Size: 10073 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080924/ab5872c1/attachment-0001.bin 


More information about the bazaar mailing list