Subject: Re: Performance issue: initial git clone causes massive repack

From: Junio C Hamano <[email-masked]>
Date: Sun, 05 Apr 2009 22:15:19 -0700

Nicolas Pitre <[email-masked]> writes:

> What git-pack-objects does in this case is not a full repack.  It 
> instead _reuse_ as much of the existing packs as possible, and only does 
> the heavy packing processing for loose objects and/or inter pack 
> boundaryes when gluing everything together for streaming over the net.  
> If for example you have a single pack because your repo is already fully 
> packed, then the "packing operation" involved during a clone should 
> merely copy the existing pack over with no further attempt at delta 
> compression.

One possibile scenario that you still need to spend memory and cycle is if
the cloned repository was packed to an excessive depth to cause many of
its objects to be in deltified form on insanely deep chains, while cloning
send-pack uses a depth that is more reasonable.  Then pack-objects invoked
by send-pack is not allowed to reuse most of the objects and would end up
redoing the delta on them.