'bzr status' stats each file multiple times

John A Meinel john at arbash-meinel.com
Sun Dec 4 21:28:51 GMT 2005


Michael Ellerman wrote:
...

> 
> No I wasn't suggesting compare_trees() cache anything, what I was thinking was 
> that we should change the algorithm so there's exactly one loop in 
> compare_trees() and it just looks at each file as it comes across it - 
> preferably in the optimal order.
> 
> But I think I see what you mean, there's likely to be other parts of the code 
> that cause a stat to occur, even when compare_trees() already has that 
> information.
> 
> I guess I just worry that putting aribtrary "x seconds" timeouts is a bad 
> idea, and might come back and bite us one day.

Well, I implemented the updates to caching. It should be available here:
http://bzr.arbash-meinel.com/branches/bzr/cache-stat/

The performance improvement isn't as much as I would like. Only about
1/8th of the time.
(So on a tree which takes 8s to "bzr st" it now takes 7s).

But strace does show that instead of doing 4+ stats of each file, I now
do 1.

I haven't decided if it is truly worth the overhead. But at least I've
shown that it could be done. And it might be worth it.

Actually, the thing that seems to take a really long time for me is the
unknowns check. I have a rather large .bzrignore, because this project
likes to build inside the tree. It's a rather large project with 1600
source files, and about 50 output executables.
So I think bzr is trying to match each file it finds against all entries
in .bzrignore.
Since a lot of them are absolute paths, I'm thinking bzr should use a
dictionary for the absolute paths, then it can just say "is path in
ignored_paths" rather than doing a fnmatchcase against each one. 50x500
files takes a while.

But I'll work on that elsewhere. :)

John
=:->

> 
> cheers
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051204/bf311a48/attachment.pgp 


More information about the bazaar mailing list