[MERGE] Tree._iter_changes
Aaron Bentley
aaron.bentley at utoronto.ca
Tue Nov 28 06:42:04 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
This bundle implements the Tree._iter_changes API, which is intended to
unify our various change-detection routines.
This will give us a single target for further optimization, and a basis
for supporting file kind changes (e.g. file -> symlink).
In particular, I expect dirstate can provide a very fast implementation,
and we may also be able to optimize revision tree comparison by using
fileids_altered_by_revision_ids.
It's possible that we'll want to tweak it a bit when dirstate lands, so
I've made it a private interface for now.
This patch uses Tree._iter_changes as the underlying implementation for
Tree.changes_from and transform.revert. If it is accepted, I will
follow-up with changes to commit and possibly merge.
The default implementation goes a long way to avoid repeatedly statting
files. With it, revert is moderately faster.
bzr.dev:
$ bzr merge ../tree-compare/; time bzr revert
All changes applied successfully.
real 0m1.154s
user 0m1.088s
sys 0m0.060s
tree-compare:
$ bzr merge ../tree-compare/; time ../tree-compare/bzr revert
All changes applied successfully.
real 0m1.113s
user 0m1.060s
sys 0m0.048s
The status benchmarks also show a moderate improvement:
bzr.dev:
bzrlib.benchmarks.bench_startup.StartupBenchmark.test_status OK
136ms/ 257ms
...us.StatusBenchmark.test_no_changes_known_kernel_like_tree OK
2569ms/58185ms
....StatusBenchmark.test_no_ignored_unknown_kernel_like_tree OK
1282ms/16247ms
...chmark.test_single_file_no_changes_known_kernel_like_tree OK
1315ms/39957ms
tree-compare:
bzrlib.benchmarks.bench_startup.StartupBenchmark.test_status OK
133ms/ 324ms
...us.StatusBenchmark.test_no_changes_known_kernel_like_tree OK
2111ms/20459ms
....StatusBenchmark.test_no_ignored_unknown_kernel_like_tree OK
1085ms/34728ms
...chmark.test_single_file_no_changes_known_kernel_like_tree OK
1097ms/29666ms
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFa9o80F+nu1YWqI0RAl7EAJ9eCE5JXyjuzEPVDn6J7gYEkSBGRACeKpmz
cPN+ytbHgiZy8YOYcwjBr+o=
=qHLx
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tree-compare.patch
Type: text/x-patch
Size: 313516 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061128/f7eacd81/attachment.bin
More information about the bazaar
mailing list