Skip to content

Commit

Permalink
relax delta selection filtering in pack-objects
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Feb 22, 2006
1 parent d9ad59e commit cac251d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,10 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
}

size = cur_entry->size;
if (size < 50)
return -1;
oldsize = old_entry->size;
sizediff = oldsize > size ? oldsize - size : size - oldsize;
if (sizediff > size / 8)

if (size < 50)
return -1;
if (old_entry->depth >= max_depth)
return 0;
Expand Down

0 comments on commit cac251d

Please sign in to comment.