[MERGE] lookup revno by iterating history
Lukáš Lalinský
lalinsky at gmail.com
Sat Mar 15 20:42:40 GMT 2008
Just out of curiosity, was something fundamentally wrong with
https://lists.ubuntu.com/archives/bazaar/2008q1/036639.html ?
On Pi, 2008-03-14 at 21:13 +0000, John Arbash Meinel wrote:
> The attached patch changes how RevisionSpec_revno() determines its
> revision id. Basically, it iterates from the tip rather than grabbing
> the whole history and then pulling out a node.
>
> It turns out to not help 'bzr log' because the log.py code calls
> _enumerate_history(). However it makes a big difference for "bzr
> revision-info -r -2". On bzr.dev it changes it from 1.4s => 0.2s. Of
> course, it also revealed that 'revision-info' wasn't locking its branch,
> so revision-info had its own problems.
>
> Regardless, it seems that building the revision_history for bzr.dev
> takes about 1s, which is getting pretty long considering we only have 3k
> revisions.
>
> So I think this is a step in the right direction, even if there are lots
> of other places that will need updating.
>
> This patch also changes Repository.iter_reverse_revision_history() to
> use a Graph and to handle ghosts as they come, rather than multiple
> calls to get_parents() which was filtering the ghosts. It should make
> revision_history() cheaper as well.
>
> In fact, the RevisionSpec change probably slows down 'log' slightly,
> since it is still grabbing the Branch.revision_history() which would
> otherwise be cached. Though the iter_reverse changes more than
> compensate. (In my numbers I save about 400ms. for bzr log --short -r -2).
>
> John
> =:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Toto je =?ISO-8859-1?Q?digit=E1lne?=
=?ISO-8859-1?Q?_podp=EDsan=E1?= =?UTF-8?Q?_=C4=8Das=C5=A5?=
=?ISO-8859-1?Q?_spr=E1vy?=
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080315/21c3c7e2/attachment-0001.pgp
More information about the bazaar
mailing list