Re: [PATCH 00/21] np/pack-v4 updates
From: Nicolas Pitre <nico@fluxnic.net>
Date: 2016-06-15 22:58:44
On Thu, 12 Sep 2013, Duy Nguyen wrote:
quoted hunk ↗ jump to hunk
On Wed, Sep 11, 2013 at 11:25 PM, Nicolas Pitre [off-list ref] wrote:quoted
On Wed, 11 Sep 2013, Duy Nguyen wrote:quoted
Nico, if you have time you may want to look into this. The result v4 pack from pack-objects on git.git for me is 35MB (one branch) while packv4-create produces 30MB (v2 is 40MB). I don't know why there is such a big difference in size. I compared. Ident dict is identical. Tree dict is a bit different (some that have same hits are ordered differently). Delta chains do not differ much. Many groups of entries in the pack are displaced though. I guess I turned a wrong knob or something in pack-objects in v4 code..Will try to have a closer look.Problem found. I encoded some trees as ref-delta instead of pv4-tree :( Something like this brings the size back to packv4-create outputdiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index f604fa5..3d9ab0e 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c@@ -1490,7 +1490,8 @@ static void check_object(struct object_entry *entry) * deltify other objects against, in order to avoid * circular deltas. */ - entry->type = entry->in_pack_type; + if (pack_version < 4) + entry->type = entry->in_pack_type; entry->delta = base_entry; entry->delta_size = entry->size; entry->delta_sibling = base_entry->delta_child;
Hmmm... I've folded this fix into your patch touching this area. This code is becoming rather subtle and messy though. We'll have to find a way to better abstract things. Especially since object data reuse will work only for blobs and tags with packv4. Commits and trees will need adjustments to their indices. Nicolas