@matheusbsbs / matheus-bagliano / commits / 51d1e83f91
Fork 0

Do not try futile object pairs when repacking.

In the repacking window, if both objects we are looking at already came from the same (old) pack-file, don't bother delta'ing them against each other. That means that we'll still always check for better deltas for (and against!) _unpacked_ objects, but assuming incremental repacks, you'll avoid the delta creation 99% of the time. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Linus Torvalds committed Jun 29, 2006 at 14:04 UTC 51d1e83f91a16363930023a5c39f79f270c04653
1 file changed +7
pack-objects.c
+7
@@ -987,6 +987,13 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
987 if (trg_entry->preferred_base)
988 return -1;
989
990 + /*
991 + * We do not bother to try a delta that we discarded
992 + * on an earlier try.
993 + */
994 + if (trg_entry->in_pack && trg_entry->in_pack == src_entry->in_pack)
995 + return 0;
996 +
997 /*
998 * If the current object is at pack edge, take the depth the
999 * objects that depend on the current object into account --