[MERGE] [BUG #172657][1.0] make 'bzr status' after merge faster

John Arbash Meinel john at arbash-meinel.com
Tue Dec 4 20:11:57 GMT 2007


The old 'bzr status' code used get_ancestry() and set membership tests to
see if a revision should be logged.

This was slow (especially with packs).

The attached patch updates the code to use Graph.find_difference() which
only searches the tips of the graph, and stops once it finds things in
common.

Which makes a rather huge difference. (time bzr status dropped from 14s to
2s for me.)

I know Robert was talking about adding a Graph.symmetric_difference() but
Graph.find_difference() actually provides all of that, and does so in a
way that you don't have to tease out what belongs to each side.

I only wish it provided a better way to iterate over the ancestry, since
it has already had to load the parents for all of those nodes.

Hmm... I wonder about Graph() keeping a cache (LRUCache?) of parents that
it has seen. It wouldn't help much for a single query, but it would help
between queries.

Anyway, this patch is good, please accept it.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 11683 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071204/6392f4c6/attachment-0001.bin 


More information about the bazaar mailing list