From: Junio C Hamano <junkio@cox.net>
To: Sergey Vlasov <vsu@altlinux.ru>
Cc: git@vger.kernel.org
Subject: Re: Shallow clone
Date: Sun, 12 Nov 2006 21:29:11 -0800 [thread overview]
Message-ID: <7vodrbap94.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vd57scong.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Sun, 12 Nov 2006 13:59:15 -0800")
Junio C Hamano <junkio@cox.net> writes:
> Sergey Vlasov <vsu@altlinux.ru> writes:
>
>> This is due to optimization in builtin-pack-objects.c:try_delta():
>>
>> /*
>> * We do not bother to try a delta that we discarded
>> * on an earlier try, but only when reusing delta data.
>> */
>> if (!no_reuse_delta && trg_entry->in_pack &&
>> trg_entry->in_pack == src_entry->in_pack)
>> return 0;
>>
>> After removing this part the shallow pack after clone is 2.6M, as it
>> should be.
>>
>> The problem with this optimization is that it is only valid if we are
>> repacking either the same set of objects as we did earlier, or its
>> superset. But if we are packing a subset of objects, there will be some
>> objects in that subset which were delta-compressed in the original pack,
>> but base objects for that deltas are not included in our subset -
>> therefore we will be unable to reuse existing deltas, and with that
>> optimization we will never try to use delta compression for these
>> objects.
>> ...
>> So any partial fetch (shallow or not) from a mostly packed repository
>> currently results in a suboptimal pack.
What we tried to avoid with the original heuristics in commit
51d1e83f was to avoid wasting time on undeltifiable blobs, and
they would be stored as base in the original packs, so I think
the following would fly better (the patch is for maint, for
master we would also check for OBJ_REF_DELTA as well).
---
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 96c069a..84a8749 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1101,7 +1101,8 @@ static int try_delta(struct unpacked *tr
* on an earlier try, but only when reusing delta data.
*/
if (!no_reuse_delta && trg_entry->in_pack &&
- trg_entry->in_pack == src_entry->in_pack)
+ trg_entry->in_pack == src_entry->in_pack &&
+ trg_entry->in_pack_type != OBJ_DELTA)
return 0;
/*
next prev parent reply other threads:[~2006-11-13 5:29 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-08 3:21 What's in git.git Junio C Hamano
2006-11-08 4:13 ` David Lang
2006-11-08 16:40 ` Shallow clone [Was Re: What's in git.git ] Aneesh Kumar K.V
2006-11-08 17:59 ` Aneesh Kumar K.V
2006-11-09 4:04 ` Shallow clone Junio C Hamano
2006-11-09 4:17 ` Aneesh Kumar
2006-11-11 13:57 ` Alexandre Julliard
2006-11-12 8:16 ` Junio C Hamano
2006-11-12 17:59 ` Sergey Vlasov
2006-11-12 21:59 ` Junio C Hamano
2006-11-13 5:29 ` Junio C Hamano [this message]
2006-11-12 13:12 ` Shallow clone [Was Re: What's in git.git ] Petr Baudis
2006-11-12 20:04 ` Shallow clone Junio C Hamano
2006-11-09 2:28 ` What's in git.git Horst H. von Brand
2006-11-09 2:54 ` Junio C Hamano
2006-11-09 3:04 ` Junio C Hamano
2006-11-09 3:45 ` Dave Dillow
2006-11-12 22:25 ` Johannes Schindelin
2006-11-08 7:40 ` Jakub Narebski
2006-11-08 7:59 ` Junio C Hamano
2006-11-08 7:58 ` Jakub Narebski
2006-11-08 8:26 ` Junio C Hamano
2006-11-08 14:51 ` Petr Baudis
2006-11-09 0:02 ` Junio C Hamano
[not found] <CAEfjWpHhLKpghGRFtzstndk_vYMkLSLAGfXx8agoQmakC-6Otg@mail.gmail.com>
2014-08-19 11:11 ` Fwd: Shallow clone Steven Evergreen
2014-08-19 12:01 ` Duy Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vodrbap94.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=vsu@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.