Parcourir la 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>
tags/v0.12.1
Shawn O. Pearce il y a 13 ans
Parent
révision
bd6853e90a

+ 4
- 2
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java Voir le fichier

@@ -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)

Chargement…
Annuler
Enregistrer