relax delta selection filtering in pack-objects
authorNicolas Pitre <nico@cam.org>
Wed, 22 Feb 2006 01:39:25 +0000 (20:39 -0500)
committerJunio C Hamano <junkio@cox.net>
Wed, 22 Feb 2006 08:36:09 +0000 (00:36 -0800)
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>
pack-objects.c

index 0c9f4c9d2390b6f024a3408d5350bb4a19f6c11d..e3946db5ca12075446223c7fd598fb2158f82d21 100644 (file)
@@ -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;