Trond Norbye's Weblog

« OpenGrok v0.6 is out | Main | I'm back.. »

http://blogs.sun.com/trond/date/20080317 Monday March 17, 2008

Bazaar support in OpenGrok

I have just added support for Bazaar repositories in OpenGrok, and thought that I should give you a warning before you start to use it...

First of all I would like to say that I have never used Bazaar in a real project, so I might have done everything totally wrong.

I am not aware of a API that lets me access Bazaar from Java, so I just created a small class that wraps the command line interface. This is the same way the Mercurial support is implemented, and most of the projects available at http://src.opensolaris.org/source use that back-end. Wrapping the binary do have a runtime-penalty, and that is the startup-cost of the binary. To reduce the number of times the binary is executed, OpenGrok already have a cache-layer for the history log (the cache-layer is not used if you try to get history information for a directory).

The biggest problem with Bazaar is that the bzr log -v command is unbelievable slow, and that is the command I need to run to get the history information (I need the files in the changeset). When I tried it on my computer, it used 13 MINUTES on the Bazaar source code itself. I got the repository with the following command:

$ bzr branch http://bazaar-vcs.org/bzr/bzr.dev bzr.dev

As a comparison hg log -v used ~ 2 secs on:

$ hg clone ssh://anon@hg.opensolaris.org/hg/onnv/onnv-gate

I would therefore not recommend that you use the Bazaar support on an OpenGrok server that serves multiple users. If you use it yourself, you should avoid accessing the directory history if you don't need it ;-)

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

Valid HTML! Valid CSS!

This is a personal weblog, I do not speak for my employer.