"bzr log" by revision-id is slow

John Arbash Meinel john at arbash-meinel.com
Thu Oct 13 10:08:09 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/13/2011 11:47 AM, Andrew Bennetts wrote:
> [CCing John for his wisdom on history-db, and dotted revnos in
> general]
> 
> Eli Zaretskii wrote:
>>> Date: Thu, 13 Oct 2011 10:23:18 +1100
> […]
>>> revision object to guide the search, so that's
>>> O(revs-in-ancestry).
>> 
>> But what I see is O(1), and the time is very long.  It almost
>> sounds
> 
> For a fixed ancestry — you're running all these measurements
> against the same emacs branch I believe — O(revs-in-ancestry) is
> O(1).  Say you made a branch into a new, standalone repository with
> precisely half as many revisions in the ancestry.  In that
> half-size repo I expect you'd find the time for that case to be
> halved.
> 
> I agree it's a bit surprising that it seems to be entirely
> independent of the position in the ancestry; I wonder if it's bulk
> loading the whole graph in advance to minimise the worst-case cost?
> Hmm, it's possible that because of edge cases calculating the
> dotted revno would often need to go as far back as the origin.
> 

'bzr log' is using RevisionSpec.in_history() which calls
Branch.revision_history(). Which always loads all the history. It may
not need to, but that is what it does today.

...

>> Can you name those, please?  I already have history_db, but the
>> time this takes with and without it is the same.
> 
> Hmm, I think that one is the newest and best of the set.  I'm a
> bit surprised it doesn't help, but I'm actually not very familiar
> with it. John may know more.  There are some older experiments that
> tried slightly different approaches, but they probably don't work
> well with current bzr versions anymore.  FWIW they are 
> https://launchpad.net/bzr-revnocache and 
> https://launchpad.net/bzr-historycache.  I'm sure John will let us
> know if I've missed any other noteworthy plugins :)
> 
> -Andrew.
> 

history_db doesn't change the time spent doing
"RevisionSpec.in_history()". We shouldn't be doing that, I'm not sure
how possible it is to change the code as it exists today.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6WuIkACgkQJdeBCYSNAAMAEwCeNLiUzFMb+lRpaNHBdUkt/lRk
E28AoKGzmOZ4BQqlIhK1+0RGYFieeJtR
=TtCD
-----END PGP SIGNATURE-----



More information about the bazaar mailing list