[darcs-users] optimising darcs annotate

Benedikt Schmidt Benedikt.Schmidt at inf.ethz.ch
Wed Oct 8 14:01:09 UTC 2008

David Roundy <droundy at darcs.net> writes:

> On Tue, Oct 07, 2008 at 01:01:23AM +0100, Eric Kow wrote:
>> On Mon, Oct 06, 2008 at 16:56:05 -0700, Jason Dagit wrote:
>> > I'm also still wondering what the previously discussed optimization to
>> > annotate is that David mentioned in this thread:
>> > http://www.mail-archive.com/darcs-users@darcs.net/msg05822.html
>> > 
>> > I asked for clarification back in August but no one replied.  Where is this
>> > well known solution documented?
>> Thanks for bringing that to the forefront.  I'm sure there is discussion
>> on this buried in our mail archives somewhere.
>> Also, I had a chance to speak with David a few weeks ago, and he
>> sketched out an idea for darcs annotate (sadly, I haven't had time to
>> transcribe my hand-written notes yet).
>> As I understand it, the solution consists in building up some sort of
>> cache that associates filenames to the patches that modify them.  Could
>> you confirm this, David?
> Yes, any sort of mapping between files and patches that modify them
> would do.  It's a simple problem (albeit extremely tedious), so it
> hasn't seemed worth documenting.  Various people have volunteered to
> do it (or one person twice), and I'm pretty certain it's in the bug
> tracker as well.

I remember writing a prototype, but never submitting a proper patch:


| I'm working on a filecache (FilePath -> [PatchId] mapping) to speed up
| annotate file and changes file. You can lookup if a patch touches
| a certain file without traversing all the patches. Then you only have
| to parse and apply the subset of patches that change the file for the
| annotation info.
| [...]
| This info is stored in _darcs/filecache/≤sha1 of filename> as

| Touch <patchid>
| RenamedTo <patchid> <new filename>
| RenamedFrom <patchid> <old filename>
| (RenamedFrom for backwards reading).
| For now, i added a optimize --filecache option to create the filecache and
| read the filecache for annotate and changes. I'm using a Map String () for
| now that uses the patchid as key and is used for checking if a certain
| patch has to be applied. I don't use Population any more for the the single
| file case if there is a filecache, but it's still used for annotate
| directory.

I'll see if I can dig up the old code and how much of it could still be
used with current darcs.


More information about the darcs-users mailing list