aboutsummaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>2007-05-28 23:20:59 +0200
committerJunio C Hamano <junkio@cox.net>2007-05-29 01:24:42 -0700
commite3dfddb377478dbee9c5b88636e97d62312f562d (patch)
treea6d5d8627d2faf1e78b3f14aa05f4b8749465874 /builtin-pack-objects.c
parent074b2eea296886e179ef73e1c364f370a223618a (diff)
downloadgit-e3dfddb377478dbee9c5b88636e97d62312f562d.tar.gz
git-e3dfddb377478dbee9c5b88636e97d62312f562d.tar.xz
builtin-pack-object: cache small deltas
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 9f035ba8e..41472fcbd 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -79,6 +79,7 @@ static int pack_compression_seen;
static unsigned long delta_cache_size = 0;
static unsigned long max_delta_cache_size = 0;
+static unsigned long cache_max_small_delta_size = 1000;
/*
* The object names in objects array are hashed with this hashtable,
@@ -1403,6 +1404,9 @@ static int delta_cacheable(struct unpacked *trg, struct unpacked *src,
if (max_delta_cache_size && delta_cache_size + delta_size > max_delta_cache_size)
return 0;
+ if (delta_size < cache_max_small_delta_size)
+ return 1;
+
/* cache delta, if objects are large enough compared to delta size */
if ((src_size >> 20) + (trg_size >> 21) > (delta_size >> 10))
return 1;
@@ -1654,6 +1658,10 @@ static int git_pack_config(const char *k, const char *v)
max_delta_cache_size = git_config_int(k, v);
return 0;
}
+ if (!strcmp(k, "pack.deltacachelimit")) {
+ cache_max_small_delta_size = git_config_int(k, v);
+ return 0;
+ }
return git_default_config(k, v);
}