[MERGE] make 'install_bundles' much cheaper

John Arbash Meinel john at arbash-meinel.com
Thu May 3 17:44:10 BST 2007


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

So I sorted out the bug with install_bundles.

We had a loop around each revision, which called 'revision_tree()'.
Inside that function, it would call
'_validate_referencese_from_repository'. With the idea that if we have a
revision in a bundle which is already present in the repository, we
should make sure their sha1 sums, etc match.

The bug was that after installing the first revision, suddenly it is in
the repository, so we validate it on the next call. And then again when
installing the *next*, and the next and the next.

It led to obviously bad behavior.

The attached patch just does one simple thing. If we have already
validated all we can with this bundle, don't do it again.

It drops the "install_bundle" times drastically, and without loss of
correctness.


bzr selftest --benchmark Install.\*few_files_small_tree_100_revision

test_few_files_small_tree_100_revision   OK     1354ms/    5720ms
test_few_files_small_tree_100_revision   OK    38071ms/   42625ms

I'll let you figure out which one is with and without the patch.


This patch also adds switches to "pretty" read lock decorators if you
are using '--lsprof-timed', since it makes it much more obvious what
functions are causing overhead.

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

iD8DBQFGOhFaJdeBCYSNAAMRAq2PAKCUplrBmqrzEsXcJw+MV3TjclrCfwCguTrA
QNxSPAlTiKb9TY6N2PsJhyg=
=iXT0
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: install_bundle_performance.patch
Type: text/x-patch
Size: 2330 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070503/5a02a94f/attachment.bin 


More information about the bazaar mailing list