瀏覽代碼

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>
tags/v0.12.1
Shawn O. Pearce 13 年之前
父節點
當前提交
bd6853e90a
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4
    2
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java

+ 4
- 2
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 {
for (List<ObjectToPack> 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<ObjectToPack> list)

Loading…
取消
儲存