From bd6853e90a58ebda706de64e7e50211e62203771 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 28 Feb 2011 16:30:23 -0800 Subject: [PATCH] PackWriter: Position tags after commits Annotated tags need to be parsed by many viewing tools, but putting them at the end of the pack hurts because kernel prefetching might not have loaded them, since they are so far from the commits they reference. Position tags right behind the commits, but before the trees. Typically the annotated tag set for a repository is very small, so the extra prefetch burden it puts on tools that don't need annotated tags (but do need commits and trees) is fairly low. Change-Id: Ibbabdd94e7d563901c0309c79a496ee049cdec50 Signed-off-by: Shawn O. Pearce --- .../src/org/eclipse/jgit/storage/pack/PackWriter.java | 6 ++++-- 1 file changed, 4 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 2a5caf854..57dca95a3 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 @@ -977,8 +977,10 @@ private void runTasks(ExecutorService pool, ThreadSafeProgressMonitor pm, } private void writeObjects(PackOutputStream out) throws IOException { - for (List list : objectsLists) - writeObjects(out, list); + writeObjects(out, objectsLists[Constants.OBJ_COMMIT]); + writeObjects(out, objectsLists[Constants.OBJ_TAG]); + writeObjects(out, objectsLists[Constants.OBJ_TREE]); + writeObjects(out, objectsLists[Constants.OBJ_BLOB]); } private void writeObjects(PackOutputStream out, List list)