[MERGE] Add an InventoryEntry cache for xml deserialization

John Arbash Meinel john at arbash-meinel.com
Thu Dec 11 00:25:26 GMT 2008


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

John Arbash Meinel wrote:

> 8) One other really big win that I didn't do is to get rid of calling
> InventoryEntry.copy() for files and symlinks. This is safe to do if the
> Inventories are treated as readonly, or if "apply_delta" would create
> new File records, but I'm not sure if we can trust Inventory users to
> not mess with the entries in our cache.
> 
> It *is* a fairly large win (25s => 20s, or about 20% of remaining time).
> So I would consider adding a flag somewhere to tell the deserializer
> that "I know I have to treat these as readonly".
> 
> (It is never safe to not copy InventoryDirectory, because its list of
> children is different even when self.revision has not changed. The old
> 'last-modified-effects-directory' issue.)
> 

A follow on really-big-win here is Inventory._make_delta() can use "if x
is y" to compare the 99.9% of entries that haven't changed, rather than
having to look at all the attributes.

Optimizing Inventory._make_delta a little bit, and enabling the
"no-copy" code, I see converting the first 1k revision of mysql to
chk-inventory drop from 2m45s => 2m flat.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklAXfYACgkQJdeBCYSNAAPn9gCgvk8n7qZXqiRGNvOm0ahaPJJb
8gIAnR0hS+UzptHYAOdUPJ9LZSqnoPnZ
=IAnq
-----END PGP SIGNATURE-----



More information about the bazaar mailing list