diff options
author | Junio C Hamano <junkio@cox.net> | 2006-05-16 14:50:26 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-16 14:50:26 -0700 |
commit | 00dd7422db1e3e0c60d41c2a2299709f90bcf3f6 (patch) | |
tree | ac03403c216129d400f041b2002d5da2091a7f98 /pack-objects.c | |
parent | Merge branch 'jc/diff' into next (diff) | |
parent | improve depth heuristic for maximum delta size (diff) | |
download | tgif-00dd7422db1e3e0c60d41c2a2299709f90bcf3f6.tar.xz |
Merge branch 'np/pack' into next
* np/pack:
improve depth heuristic for maximum delta size
Diffstat (limited to 'pack-objects.c')
-rw-r--r-- | pack-objects.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pack-objects.c b/pack-objects.c index 566a2a2349..77284cfdba 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -1036,9 +1036,12 @@ static int try_delta(struct unpacked *trg, struct unpacked *src, if (src_entry->depth >= max_depth) return 0; - /* Now some size filtering euristics. */ + /* Now some size filtering heuristics. */ size = trg_entry->size; - max_size = (size/2 - 20) / (src_entry->depth + 1); + max_size = size/2 - 20; + max_size = max_size * (max_depth - src_entry->depth) / max_depth; + if (max_size == 0) + return 0; if (trg_entry->delta && trg_entry->delta_size <= max_size) max_size = trg_entry->delta_size-1; src_size = src_entry->size; |