[MERGE] don't double parse the basis inventory

John Arbash Meinel john at arbash-meinel.com
Tue Feb 13 22:34:50 GMT 2007


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

I was looking into the Commit code as part of the dirstate branch, and I
came across this simple fix, which I think can be merged completely
independently.

Basically, in the code we have, it asks the working_tree for its basis
tree and inventory, and then it gathers all parent inventories as a
separate step. But it already has the first inventory.

This should remove a complete inventory read + parse step as part doing
a commit.

All the tests still pass, and I can see that there is one less
_unpack_inventory call when profiling commit.

I could see writing a test which instruments things to check how many
get_inventory calls there are, but it seems a little dependent on what
working-tree format we are using. Since they may cache in different
ways. (Certainly dirstate has the potential for not making any
get_inventory calls).

I'll write a test if it is required to get this merged, though.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF0j0KJdeBCYSNAAMRAiWeAJ0Qbjv1y2uI4mSwCzBkJXJSptWT/QCgwoec
ivANl2XWFxNMqAm+JNwAGsA=
=Oj53
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avoid_extra_deserialization.patch
Type: text/x-patch
Size: 1327 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070213/d9209cdc/attachment.bin 


More information about the bazaar mailing list