From 2610eaf386f37386e9886a8635d499ebf772a240 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 13 Aug 2011 17:01:24 -0700 Subject: [PATCH] Revert "PackWriter: Do not delta compress already packed objects" This reverts commit 67b064fc9fa7418fab83957b4f4e4baf9c6e08be. The "tiny optimization" introduced by 67b0 turns out to have a big savings on wall-clock time when the object store is very slow (e.g. the DHT support in JGit), but comes with a much bigger penalty in space used by the output stream. CGit packed with 67b0 enabled is 7 MiB larger than it should be (36 MiB rather than 28/29 MiB). The much bigger Linux kernel repository gained over 200 MiB, though some of this may have been caused by a smaller window setting. Revert this patch as PackWriter should be optimizing for space used rather than time spent, since its primary use is network transfer, and that isn't free. Change-Id: I7413a9ef89762208159b4a1adc5a22a4c9245611 Signed-off-by: Shawn O. Pearce --- .../src/org/eclipse/jgit/storage/pack/PackWriter.java | 4 ++-- 1 file 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 2153ad5d3f..8c3d52afcd 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 @@ -909,10 +909,10 @@ public class PackWriter { private int findObjectsNeedingDelta(ObjectToPack[] list, int cnt, int type) { for (ObjectToPack otp : objectsLists[type]) { - if (otp.isReuseAsIs()) // already reusing a representation - continue; if (otp.isDoNotDelta()) // delta is disabled for this path continue; + if (otp.isDeltaRepresentation()) // already reusing a delta + continue; otp.setWeight(0); list[cnt++] = otp; } -- 2.39.5