libgit2/libgit2 — pull request #1244 by carlosmn (2013-01-14 17:02:42+00:00)
Title: A comparison of eviction algorithms for the delta base cache

These two commits represent attempts at making the cache entry eviction algorithm take less time out of the indexing process. Evicting one at a time is quite bad, and by testing it turned out that 8 was a good number of entries to evict at a time. This is the first commit.

Then @schu came up with the idea of just throwing away everything and giving the cache a fresh start. This is the second commit.

These are the results of running `cgit2 index-pack` on a 625MB packfile containing a somewhat old version of the linux kernel.

* current development algo: over 9 minutes, so I killed it
* evict the 8 LRU entries: 192s, 3:25
* drop the whole cache: 134s, 2:27

I anybody has a better suggestion for an algorithm, I'm all ears.