Can "bzr annotate" be sped up?
John Arbash Meinel
john at arbash-meinel.com
Sat Jun 18 08:16:10 UTC 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/18/2011 09:45 AM, vila wrote:
>>>>>> Alexander Belchenko <bialix at ukr.net> writes:
>
> > 17.06.2011 14:04, John Arbash Meinel пишет:
> >> 1) Annotate in 'reverse' mode. Forward mode is a bit more obvious. You
> >> start at a rev, mark all lines as 'modified in rev 1'. Then grab the
> >> second rev, and lines that match are left alone, lines which are new are
> >> marked 'rev2'. Then on to rev3, etc.
> >>
> >> In reverse mode, you start at rev3 and mark all lines as 'unknown'. Then
> >> you compare with rev2. All lines that match are left as 'unknown', new
> >> lines in rev3 are marked 'rev3'. That isn't particularly hard, the
> >> trickier part is dealing with merge-parents. (Lines are new in the
> >> current text vs the first parent, but that is because they came from the
> >> second parent.)
>
> > Very interesting, thanks for sharing it. I think reverse mode is very
> > important, esp. if the system want to support history horizons. Then
> > you don't have access to older revisions, so reverse order should work
> > better, IMO.
>
> Agreed.
>
> But I'll go even further. The two main contenders so far seem to be:
>
> 1) Annotating in reverse order
>
> 2) Restricting annotations to a line range.
>
> I think in most of the cases line range won't work well as you need the
> whole file to track the range. This can be bound to the highest line but
> I don't expect a lot to be gained this way (even if you can limit the
> processing you still need to process a significant part of the file).
>
> Reverse order in contrast may be designed to work asynchronously:
>
> - start with the file current content with no annotations,
>
> - provides the annotations as they are discovered.
>
> This requires collaboration from the client side but since the user is
> generally interested by the most recent changes the end result will be
> available sooner. And while the user is analyzing the first annotations,
> the older ones can be provided later, up to the least interesting ones.
>
> Vincent
>
You pretty much have to do both to get any sort of interesting speedup.
If you annotate in forward order, you don't save any time restricting
the range.
If you annotate in reverse order, you don't save any time if you wait
for the whole file to be annotated (because *most* of the time, some of
the lines will be very very old.)
It does need tool support. And a new API in general, and a whole bunch
of stuff that takes development time. Contrast that with just making
"bzr annotate foo" faster by caching. Which takes some implementation
time. Which would you rather have first?
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk38XsoACgkQJdeBCYSNAAOyUACgtrITas3yapFkQDczMWYV0kjB
jDgAnj9pbNEVKWRCheIn7zMuj+0R5Ybx
=4Ab/
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list