bzr status after merge slower with packs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
John A Meinel |
Bug Description
After doing a 'bzr merge' when running 'bzr status' it takes longer than
expected to display the revisions that are now merged.
It very quickly displays the list of changed files, and gets to:
pending merges:
And then it sits for a while while it extracts the revisions it needs.
Currently, to determine the merge ancestry (what revisions in the merged parent
are new and not already present in the target) it extracts the full revision
history, and then does (effectively) a set difference.
I tracked it down into knit_repo.
(one for each head). Out of 18s for the complete command 14.3s is spent in
_lookup_
We probably could use the Graph LCA code to find nodes which are present in one
head that are not in the other one, without having to search the entire history.
I'll post the full callgrind in a second, but the quick lsprof summary is:
26703 14.297 6.482 bzrlib.
+698272 5.921 2.081 +bzrlib.
+31642 0.272 0.259 +bzrlib.
+382215 0.166 0.166 +<method 'append' of 'list' objects>
+349089 0.122 0.122 +<len>
+53406 1.326 0.038 +bzrlib.
+374 0.003 0.001 +bzrlib.
+521 0.000 0.000 +<method 'update' of 'set' objects>
There are some other issues here, though.
We are looking up approximately 15k revisions, (though we are doing it 2
times). Presumably we get 26.7k calls because all of those merge revisions get
to look up both parents at the same time.
I don't quite understand how that translates into 700k calls to _parsed_key_index.
I think we should possibly re-evaluate how the bisection is working.
Considering that reading from the disk is only costing 1.3s, it seems that we
have a sub-optimal memory layout. (It is costing 5.9s to bisect through the
memory structure for every key we are looking for.)
I'm not sure if you looked at my bisect_multi code for dirstate, which did use
a sorted request so that it could quickly partition the requested keys. It
might be worthwhile to do that with the memory structure.
Related branches
Changed in bzr: | |
importance: | Undecided → Medium |
In the associated branch, we use Graph.find_ difference( ) rather than grabbing the full ancestry of all revisions.