Merge lp:~abentley/bzr/preview-tree-changes-cache into lp:bzr/2.0
Proposed by
Aaron Bentley
Status: | Merged |
---|---|
Approved by: | John A Meinel |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~abentley/bzr/preview-tree-changes-cache |
Merge into: | lp:bzr/2.0 |
Diff against target: |
84 lines 3 files modified
NEWS (+3/-0) bzrlib/tests/test_transform.py (+4/-2) bzrlib/transform.py (+6/-9) |
To merge this branch: | bzr merge lp:~abentley/bzr/preview-tree-changes-cache |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John A Meinel | Approve | ||
Review via email: mp+12607@code.launchpad.net |
To post a comment you must log in.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
This patch causes PreviewTree to memoize the iter_changes values for its
TreeTransform. It speeds up PreviewTree dramatically when there are
large numbers of changes. The current behaviour scales O(n^2), and this
changes it to O(n).
Best of three runs of "bzr merge --preview ../bzr.dev" in bzr.ab:
Before:
real 2m29.827s
user 2m24.669s
sys 0m2.816s
After:
real 0m6.725s
user 0m6.064s
sys 0m0.552s
This is ~ 22x faster, and the improvemnt will scale with the number of
changes involved. (this merge involved ~585 files) "merge --preview",
"merge --interactive" and unshelve would be the primary winners in bzr.
Launchpad's code review diff generation would become faster and more
reliable. Launchpad's branch -> translation export might be somewhat
improved. bzr-pipeline's pump command would be faster.
Memoizing these values is acceptable because altering the TreeTransform
(or its base tree) after calling get_preview_tree() invalidates that
preview tree.
I'm submitting this to the 2.0 branch because it is a small change that
doesn't affect the API.
Aaron enigmail. mozdev. org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkr CUw4ACgkQ0F+ nu1YWqI0dKACght Aubau4t9Xy+ 9ohpwcZD1H1 6D+HTLl/ DXAccc3i6NXZ2Uj G
t/wAnjr/
=nIfK
-----END PGP SIGNATURE-----