]> source.dussan.org Git - jgit.git/commit
Make DeltaBaseCache per-ObjectReader 94/2994/1
authorShawn O. Pearce <spearce@spearce.org>
Sat, 2 Apr 2011 00:42:06 +0000 (20:42 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 2 Apr 2011 00:42:06 +0000 (20:42 -0400)
commit53fb027284af07c0344d3da6187a08afbfed59f0
treec2cd3ad2c811eb5e6330703fd7e3bf58d1c46e3b
parentffbaf694e28fcc62c50326cd555d8f2646d31a0d
Make DeltaBaseCache per-ObjectReader

The 'Counting objects' phase of PackWriter requires good hit rates
from the DeltaBaseCache while walking trees, the deltas need to find
their bases in the cache in order to inflate in a reasonable time.

If JGit is running in a multi-threaded server, such as Gerrit Code
Review, each thread needs its own DeltaBaseCache to prevent one thread
from evicting the other thread's relevant bases.  Move the cache to be
per-ObjectReader, lazily allocated when required by a PackFile.

Change-Id: If9d5ed06728e813632ae96dcfb811f4860b276e8
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/DeltaBaseCache.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/WindowCursor.java