[MERGE] Set allow_optimize=False when spilling btree content to disk

John Arbash Meinel john at arbash-meinel.com
Thu Mar 19 20:23:29 GMT 2009


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

The attached patch changes the btree code slightly when spilling indices
to disk to avoid memory pressure.

Prior to this, if you called "set_optimize(for_size=True)" (as we do
during 'bzr pack', and as the groupcompress does for 'autopack' as
well), it would create all indexes in "maximum packed" form.

However, when spilling to disk, we only do that to reduce memory
pressure, since we are going to come back and rebuild it into a new
index anyway.

It doesn't have any tests, because we don't really have testing of how
the "_optimize_for_size" gets passed around. The details seem a bit
hidden, and the amount of time to rewrite the code to get it testable
seemed a rather high barrier to entry.

I'm sending a follow up to this, and when combining the two bits, it
shaves ~1m / 11m on 'bzr pack' of a launchpad tree.

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

iEYEARECAAYFAknCqcEACgkQJdeBCYSNAANy6gCeIa3D5/jqoHme2TKIH2hc0hsC
S8sAn0xKFuvMYfsjoZLBBN1eqsU0H6CM
=6CrA
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 1.14-btree_spill.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20090319/deb9bc0b/attachment.diff 


More information about the bazaar mailing list