Browse Source

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 <spearce@spearce.org>
stable-0.12
Shawn O. Pearce 14 years ago
parent
commit
bd6853e90a
  1. 6
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java

6
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java

@ -977,8 +977,10 @@ public class PackWriter {
} }
private void writeObjects(PackOutputStream out) throws IOException { private void writeObjects(PackOutputStream out) throws IOException {
for (List<ObjectToPack> list : objectsLists) writeObjects(out, objectsLists[Constants.OBJ_COMMIT]);
writeObjects(out, list); writeObjects(out, objectsLists[Constants.OBJ_TAG]);
writeObjects(out, objectsLists[Constants.OBJ_TREE]);
writeObjects(out, objectsLists[Constants.OBJ_BLOB]);
} }
private void writeObjects(PackOutputStream out, List<ObjectToPack> list) private void writeObjects(PackOutputStream out, List<ObjectToPack> list)

Loading…
Cancel
Save