diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2011-11-17 11:44:43 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2011-11-18 15:55:52 -0800 |
commit | 41a18d57bcaf3bb7eb4bcee5c1d53a222d07316b (patch) | |
tree | 569cd101ebf4399d0d1c8b5829af9c05c80849b5 /org.eclipse.jgit | |
parent | 29997ab0840dbac89106691264c7768de6d47322 (diff) | |
download | jgit-41a18d57bcaf3bb7eb4bcee5c1d53a222d07316b.tar.gz jgit-41a18d57bcaf3bb7eb4bcee5c1d53a222d07316b.zip |
Search for annotated tag reuse first
Annotated tags are relatively rare and currently are scheduled in a
pack file near the commits, decreasing the time it takes to resolve
client requests reading tags as part of a history traversal.
Putting them first before the commits allows the storage system to
page in the tag area, and have it relatively hot in the LRU when
the nearby commit area gets examined too. Later looking at the
tree and blob data will pollute the cache, making it more likely
the tags are not loaded and would require file IO.
Change-Id: I425f1f63ef937b8447c396939222ea20fdda290f
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java index f088d3224c..dc33e4ece7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java @@ -968,10 +968,10 @@ public class PackWriter { if (cnt <= 4096) { // For small object counts, do everything as one list. BlockList<ObjectToPack> tmp = new BlockList<ObjectToPack>(cnt); + tmp.addAll(objectsLists[Constants.OBJ_TAG]); tmp.addAll(objectsLists[Constants.OBJ_COMMIT]); tmp.addAll(objectsLists[Constants.OBJ_TREE]); tmp.addAll(objectsLists[Constants.OBJ_BLOB]); - tmp.addAll(objectsLists[Constants.OBJ_TAG]); searchForReuse(monitor, tmp); if (pruneCurrentObjectList) { // If the list was pruned, we need to re-prune the main lists. @@ -982,10 +982,10 @@ public class PackWriter { } } else { + searchForReuse(monitor, objectsLists[Constants.OBJ_TAG]); searchForReuse(monitor, objectsLists[Constants.OBJ_COMMIT]); searchForReuse(monitor, objectsLists[Constants.OBJ_TREE]); searchForReuse(monitor, objectsLists[Constants.OBJ_BLOB]); - searchForReuse(monitor, objectsLists[Constants.OBJ_TAG]); } endPhase(monitor); |