Accelerate build_tree by using working tree files

Aaron Bentley aaron.bentley at utoronto.ca
Fri Dec 21 02:36:56 GMT 2007


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

Ian Clatworthy wrote:
> Aaron Bentley wrote:
> 
>> I think these are sub-optimal results, because AFAICT, you're running
>> against a dirty dirstate.  _iter_changes should have no reason to call
>> os.sha_file_by_name, because it should all be in dirstate.  But in fact,
>> it's being called 37 667 times!
> 
> That's the number of (real) files in the tree. At that point in the
> script, the only things that have been done are:
> 
> init repo
> init
> add
> commit

If you add 'status' here, it should set up dirstate.  But I am surprised
that it's not being updated as part of 'commit'.  Unless the files are
all less than 2 seconds old when you commit.

> I don't have time right now to look any deeper as I have one or two
> other things to wrap up before my break. Either commit isn't updating
> the dirstate or the dirstate is being generated for the new branch, yes?

Generating the dirstate for the new branch wouldn't cause any sha1s to
be calculated.  It's got to be that commit isn't updating dirstate.

> Can we and should we optimise the dirstate generation of the new branch
> using information from the old one?

I think the only case where that would make sense is when hardlinking
working trees.  But in that case, you should be able to copy the stat
data and sha1s for hardlinked files from the old tree into the new one.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFHaybI0F+nu1YWqI0RAjv+AJdtvFSVLxQ6NJCAwwAi7wEXJNgTAJ0QlFkj
hATbH5mnEmIfUiOl9/ENJg==
=HM+L
-----END PGP SIGNATURE-----



More information about the bazaar mailing list