From a49dd05fd047f504a74fb053bb8ddbb9e4bd152b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 15 Feb 2006 17:34:29 -0800 Subject: pack-objects: reuse data from existing packs. When generating a new pack, notice if we have already needed objects in existing packs. If an object is stored deltified, and its base object is also what we are going to pack, then reuse the existing deltified representation unconditionally, bypassing all the expensive find_deltas() and try_deltas() calls. Also, notice if what we are going to write out exactly match what is already in an existing pack (either deltified or just compressed). In such a case, we can just copy it instead of going through the usual uncompressing & recompressing cycle. Without this patch, in linux-2.6 repository with about 1500 loose objects and a single mega pack: $ git-rev-list --objects v2.6.16-rc3 >RL $ wc -l RL 184141 RL $ time git-pack-objects p --- pack.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pack.h') diff --git a/pack.h b/pack.h index 9dafa2b6d2..694e0c56f0 100644 --- a/pack.h +++ b/pack.h @@ -29,5 +29,7 @@ struct pack_header { }; extern int verify_pack(struct packed_git *, int); - +extern int check_reuse_pack_delta(struct packed_git *, unsigned long, + unsigned char *, unsigned long *, + enum object_type *); #endif -- cgit v1.2.1