summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd346f1)
raw | patch | inline | side by side (parent: bd346f1)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 28 Apr 2006 02:31:46 +0000 (19:31 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 28 Apr 2006 02:31:46 +0000 (19:31 -0700) |
We used to omit delta base candidates that is much bigger than
the target, but delta size does not grow when we delete more, so
that was not a very good heuristics.
Signed-off-by: Junio C Hamano <junkio@cox.net>
the target, but delta size does not grow when we delete more, so
that was not a very good heuristics.
Signed-off-by: Junio C Hamano <junkio@cox.net>
pack-objects.c | patch | blob | history |
diff --git a/pack-objects.c b/pack-objects.c
index c0acc460bb9df0313e314eb2cf48363b2458082c..66043381317b118dd525d547479d81b75d6b89f8 100644 (file)
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -1032,12 +1032,6 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
max_depth -= cur_entry->delta_limit;
}
- size = cur_entry->size;
- oldsize = old_entry->size;
- sizediff = oldsize > size ? oldsize - size : size - oldsize;
-
- if (size < 50)
- return -1;
if (old_entry->depth >= max_depth)
return 0;
@@ -1048,9 +1042,12 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
* more space-efficient (deletes don't have to say _what_ they
* delete).
*/
+ size = cur_entry->size;
max_size = size / 2 - 20;
if (cur_entry->delta)
max_size = cur_entry->delta_size-1;
+ oldsize = old_entry->size;
+ sizediff = oldsize < size ? size - oldsize : 0;
if (sizediff >= max_size)
return 0;
delta_buf = diff_delta(old->data, oldsize,
*/
continue;
+ if (entry->size < 50)
+ continue;
+
free(n->data);
n->entry = entry;
n->data = read_sha1_file(entry->sha1, type, &size);