There are a couple of patches on the mailing list that should address this.
Basically, the current bzr --revision lookup has 2 "iterate the history to figure out the revno" calls which aren't actually needed.
The patches work around it a bit, and in my testing drops it from 14s => 0.7s.
So it isn't the common ancestor code (Graph.find_unique_lca) it is the "revision_id => revno" (RevisionSpec) code.
There are a couple of patches on the mailing list that should address this.
Basically, the current bzr --revision lookup has 2 "iterate the history to figure out the revno" calls which aren't actually needed.
The patches work around it a bit, and in my testing drops it from 14s => 0.7s.
So it isn't the common ancestor code (Graph. find_unique_ lca) it is the "revision_id => revno" (RevisionSpec) code.