[darcs-devel] darcs patch: Implement caching of git sequences in GitRepo.

Juliusz Chroboczek Juliusz.Chroboczek at pps.jussieu.fr
Tue Nov 1 22:18:49 PST 2005


> I think I understand what this is doing.  It's creating a rather clever
> monad to hold a cache of arbitrary objects that have a String key.  Except
> it isn't really holding arbitrary objects, it's holding structured
> sequences, which are a bit trickier.

Not quite.  It's holding a cache of such sequences indeed, but the
tricky bit is the semantics of the cache: if the cache is of the form

  [..., [("A",a),("B",b),("C",c)], ...]

and we search for the key "B", then the cache will return [("B",b),("C",c)].

If you want, it's a cache designed for holding histories.

> I saw your email to haskell-cafe (about weak hash tables), and I guess your
> hope is to change from a [SSequence a] to a hash table of SSequence a?

No.  The weak hashtable is for something different -- it's for holding
GitFiles.  Right now, we hit the disk for every call to readGitFile.
However, in many cases a given GitFile is already in memory, so we
might as well reuse that.

(Pro memoria, GitFiles are used for commits, for trees and for files.)

                                        Juliusz




More information about the darcs-devel mailing list