[MERGE] Use a dict to access stat cache information from dirstate.
Robert Collins
robertc at robertcollins.net
Wed Oct 24 06:56:36 BST 2007
On Wed, 2007-10-24 at 15:41 +1000, Ian Clatworthy wrote:
>
>
> I suspect this could be made faster still by:
>
> 1. moving the if test into the top method, saving a method call
Thats 15ms across the entire commit; at this point I don't think the
layering ugliness is worth it.
> 2. using a temporary variable for tree_details[0]
I think the primary win has been made, and I'm hoping to obsolete this
method altogether, so I'd like to just leave it. As you voted tweak I'll
send it in if Martin ok's it for 0.92, we can manipulate it further
later easily.
> 3. doing a normal 'set' instead of using setdefault.
>
> Is there a particular reason you use setdefault instead of a plain
>
> index[x] = y
>
> statement? If so, it's not obvious to me which suggests it needs a
> comment.
mental fart, fixed.
> For a partial commit, perhaps we should only loop over those entries
> instead of all of them as well?
Yes, this would be a good future improvement. However, its worth noting
that the third of my performance figures *was* a partial commit, so the
time to populate the cache would seem to be tiny.
> My only other comment is that the creation and clearing of the cache
> all
> look good but I wonder if you should ever be updating it?
Not at this point no - we don't from bzr's command line add, stat(to
populate the cache), and then commit, in one lock.
-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071024/6f8328fc/attachment.pgp
More information about the bazaar
mailing list