Skip to content

Commit cac251d

Browse files
Nicolas PitreJunio C Hamano
authored andcommitted
relax delta selection filtering in pack-objects
This change provides a 8% saving on the pack size with a 4% CPU time increase for git-repack -a on the current git archive. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent d9ad59e commit cac251d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pack-objects.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,11 +629,10 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
629629
}
630630

631631
size = cur_entry->size;
632-
if (size < 50)
633-
return -1;
634632
oldsize = old_entry->size;
635633
sizediff = oldsize > size ? oldsize - size : size - oldsize;
636-
if (sizediff > size / 8)
634+
635+
if (size < 50)
637636
return -1;
638637
if (old_entry->depth >= max_depth)
639638
return 0;

0 commit comments

Comments
 (0)