Re: [PATCH 08/13] prevent try_delta from using objects not in pack
- From
Nicolas Pitre <nico@cam.org>
- Date
- Apr 6, 2007, 14:59 UTC
- Message-ID
- <alpine.LFD.0.98.0704060859230.28181@xanadu.home>
- In-Reply-To
- <56b7f5510704052047r30166e53kffbdd8bf71885264@mail.gmail.com>
On Thu, 5 Apr 2007, Dana How wrote:
Show 5 quoted lines
> Currently we have get_object_list -> traverse_commit_list ->
> show_{commit,object} -> add_object_entry , which is all
> called way before get_object_details -> check_object -> sha1_object_info .
> Can I safely move the sha1_object_info calll earlier into
> add_object_entry so I will know the size for pruning?I think so, yes. And actually this call to sha1_object_info() has been bothering me for a while.
There are currently two ways to get the list of objects to pack: one is from stdin where objects are listed with their SHA1's, the other one uses the internal revision walking code. In the later case we _already_ have the information that sha1_object_info() later provides making it rather wasteful by forcing a second object header parsing.
However... aren't you more interested in the _compressed_ blob size than its raw size?
> In your other email you mention memory consumption due to object_entry. > This structure could benefit somewhat from some attention beyond removing > my no_write.(e.g. int->short for .depth and .delta_limit; int->enum > for .preferred_base). Perhaps for later.
Sure.
Nicolas