bug? find_branches or find_bzrdir tries to open all files as bzr locations

Alexander Belchenko bialix at ukr.net
Wed May 18 09:25:45 UTC 2011


OK, I was wrong in my assumption that bzr tries to open location many times.

But I've hacked a small plugin to check whether I can have faster 
find_branches if I will try to open only directories as branches.
The code available at lp:~bialix/+junk/bzr-find-branches

I understand that my code could do something wrong, but as I can see my 
custom find_branches provide the same output as BzrDir.find_branches().
There is one shortcut though: I check only directories, skip symlinks, 
but I don't have symlinks on my Windows anyway.

Here are some numbers for 2 cases.

1) My job hive of branches.
As of today we have 792 branches on our server. I've made copy of the 
entire hive on my local machine and then run various find_branches 
implementations.

bzr find-branches --native  ~44 sec
bzr find-branches --custom  ~27 sec

bzrtools' branches command provides the time very close to --native, so 
I omit it.

2) My colo-workspace of bzr.dev. I have 5 branches inside .bzr/branches 
shared repository in colo-workspace. Also at the time of testing the 
working tree has

In the working tree:
       1399 unchanged
          0 modified
          0 added
          0 removed
          0 renamed
          1 unknown
        642 ignored
        122 versioned subdirectories


I think we can assume that number of plain files is 10 times of number 
of directories.

Time:

bzr colo-branches           ~1.7 sec
bzr find-branches --native  ~6   sec   (the same for bzr branches)
bzr find-branches --custom  ~1.6 sec

Note that colo-branches is only looking for branches inside .bzr/branches.

So, if I did something wrong I'd like to know what I did wrong.



More information about the bazaar mailing list