]> source.dussan.org Git - jgit.git/commit
PackWriter: Speed up pruning of objects from cached packs 76/2776/4
authorShawn O. Pearce <spearce@spearce.org>
Fri, 18 Mar 2011 15:29:26 +0000 (08:29 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 1 Apr 2011 21:40:33 +0000 (17:40 -0400)
commit9f5bbb5dd41f87d6428eb49c021e00d8099d0c17
treedf2f2aa7976094e8e8927f66c48c364120aa4d2e
parent00eae14a7f736640da0086a9a9eb73ed50963eb8
PackWriter: Speed up pruning of objects from cached packs

During object enumeration for the thin pack, very few objects come
out that are duplicated with the cached pack. Typically these are
only cases where a blob or tree was cherry-picked forward, got a
copy or rename, or was reverted... all relatively infrequent events.

Speed up pruning of the thin pack object list by combining the phase
with the object representation selection. Implementers should already
be offering to reuse the object from the cached pack if it is stored
there, at which point the implementation can perform a very fast type
of containment test using the cached pack's identity rather than yet
another index lookup.  For the local disk case this is probably not a
big improvement, but it does help on the DHT implementation where the
two passes combined into one reduces latency.

Change-Id: I6a07fc75d9075bf6233e967360b6546f9e9a2b33
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/LocalCachedPack.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/CachedPack.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectReuseAsIs.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java