]> source.dussan.org Git - jgit.git/commit
PackWriter: Parse tag target objects in a batch 40/2540/1
authorShawn O. Pearce <spearce@spearce.org>
Sat, 19 Feb 2011 01:31:32 +0000 (17:31 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 19 Feb 2011 02:15:25 +0000 (18:15 -0800)
commit19037e8cfc2d9534f79e40c898fdaeacaf499e82
tree8a770eb67ed401738b5e78d191595d1d72e28b0c
parent3e64b928d51b3a28e89cfe2a3f0eeae35ef07839
PackWriter: Parse tag target objects in a batch

If the underlying storage has a high latency per SHA-1 lookup
(e.g. the DHT support we are working on), parsing each wanted
annotated tag object back to its underlying commit is too slow,
its a sequential lookup for each tag.  With hundreds of tags in
a repository this takes far too long.

Instead queue up a list of the tags whose objects need to be found,
and then locate all of those in one parseAny batch.  This works
for the common case of annotated tag to single tree or commit.
For the less often used tag->tag->commit, it at least gets us
one level parsed in the larger batch before we have to go back to
sequential lookups.

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