bazaar performance question

Frits Jalvingh jal at etc.to
Mon Jan 7 20:48:01 UTC 2013


Ok: just for reference and to help other googlers with similar problems ;-)

I ended up by coding around the problem. Since I need to do a lot of "bzr
missing" commands between often the same branches I wrote a piece of code
that caches the revision set for a branch. It does that as follows:

1. try to load the cached set of revision IDs from the cache file.
2. do a bzr log -r -1 on the branch
3. if the loading failed, or if the tip revision of the cached copy differs
from the result of the log -r -1: rebuild the cached copy && save the
inventory as a local cache file.

The cached copy is constructed by doing bzr xmllog --include-merges,
reading the result and extracting all revision IDs from it. For some
reason, that bzr log is surprisingly fast: just 2 or 3 seconds. So the
first time I need the "revision history" for a branch it takes 3 seconds;
from then on it just takes < 100ms to load and check the cached result.

The "missing" operation was reimplemented by just comparing two of the
above "inventories" and checking missing and added revisions, which is a
hashset operation which is also very fast.

The net result is that for this type of "repeated" missing operation the
speedup is huge: for the repeated set of comparisons most actions went from
taking 4 minutes to taking 14 seconds.

Greetings,

Frits



On Thu, Dec 13, 2012 at 11:00 AM, John Arbash Meinel <john at arbash-meinel.com
> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 2012-12-12 23:03, Frits Jalvingh wrote:
> > Hi John, thanks for answering.
> >
> > I cannot script it internally directly - the application is a Java
> > application. And sadly enough I fear I would need way to much
> > Python + Bazaar-internals knowledge (I have neither) to code this
> > myself, hence my hope there was something already ;-) I checked out
> > the extension you mentioned but cannot find out really how to use
> > it; I tried
> >
> > jal at cite:~/puzzler-bzr/master/vp/4.0$ bzr history-db-create --db
> > test bzr: ERROR: No module named history_db You may need to install
> > this Python library separately.
> >
> > And that's it ;-)
> >
> > Frits
>
> Did you install it in your plugin path as "history_db" rather than
> "bzr-history-db" or "bzr_history_db" ?
>
> John
> =:->
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (Cygwin)
> Comment: Using GnuPG with undefined - http://www.enigmail.net/
>
> iEYEARECAAYFAlDJp00ACgkQJdeBCYSNAAORxgCgsU9UrMh0E5oed/MJ/6BxG4Ei
> CMwAoJwdBm6zy3Y1vBosNGqFVx2cgX1n
> =z3Ud
> -----END PGP SIGNATURE-----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20130107/77cddefa/attachment.html>


More information about the bazaar mailing list