[RFC][MERGE] Avoid using revision_history() in RevisionSpec when possible

Lukáš Lalinský lalinsky at gmail.com
Mon Dec 3 23:21:37 GMT 2007


Hi,

this patch implements BzrBranch6.get_rev_id, which is (thanks to
last-revision) possible to do incrementally without loading the whole
history. In the worst case it shouldn't be slower than the previous
method, in the best case it can avoid touching the index at all. For the
last revision you get:

$ time bzr diff -c -1 >/dev/null

real    0m7.844s
user    0m7.404s
sys     0m0.244s

$ time bzr diff -c -1 >/dev/null

real    0m0.882s
user    0m0.800s
sys     0m0.056s

For the 10th revision from the end:

$ time bzr diff -c -10 >/dev/null

real    0m7.762s
user    0m7.324s
sys     0m0.296s

$ time ./bzr diff -c -10 >/dev/null

real    0m0.957s
user    0m0.820s
sys     0m0.092s

And for the first revision:


$ time bzr diff -c 1 >/dev/null

real    0m7.728s
user    0m6.720s
sys     0m0.364s

$ time bzr diff -c 1 >/dev/null

real    0m7.619s
user    0m7.180s
sys     0m0.292s

So it seems to help, but I'm not sure if it's implemented the right
way...

Lukas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr-mail-Br7ooI.patch
Type: text/x-patch
Size: 27499 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071204/2bfb314f/attachment-0001.bin 


More information about the bazaar mailing list