From: Jeff King <peff@peff.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Git mailing list <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: Git packs friendly to block-level deduplication
Date: Wed, 24 Jan 2018 19:29:42 -0500 [thread overview]
Message-ID: <20180125002942.GA21184@sigill.intra.peff.net> (raw)
In-Reply-To: <20180125001015.GA17856@sigill.intra.peff.net>
On Wed, Jan 24, 2018 at 07:10:15PM -0500, Jeff King wrote:
> On Thu, Jan 25, 2018 at 01:03:25AM +0100, Ævar Arnfjörð Bjarmason wrote:
>
> > > You may also want to use "--threads=1" to avoid non-determinism in the
> > > generated packs. In theory, both repos would then produce identical base
> > > packs, though it does not seem to do so in practice (I didn't dig in to
> > > what the different may be).
> >
> > ..and north of 20% with --threads=1.
> >
> > [...]
> >
> > Thanks. I'll look into that, although the above results (sans hacking on
> > the core pack-objects logic) suggest that even once I create an island
> > I'm getting at most 20%.
>
> I think it may be worth figuring out where the two differ. With
> --no-reuse-object and --no-reuse-delta, I'd think that the pack
> generated for a particular apex commit would be totally deterministic,
> regardless of other objects available in the repo. But it's not for some
> reason.
I think I see it. If I compare the objects in pack-order of the two
packs:
diff -u <(git show-index <$one | sort -n) <(git show-index <$two | sort -n)
I get:
6281 fac64e011f1b1ecabcccf7ad2511efcac3e26bdc (9381a4f9)
6585 59c276cf4da0705064c32c9dba54baefa282ea55 (1b02a1c0)
6869 8279ed033f703d4115bee620dccd32a9ec94d9aa (ca7acf33)
-7042 298d861208d71089dd308761ae96738e81ad3e68 (135aefd7)
-7222 ea7b5de1c1187294d3d4dca93b129e049ca7ca76 (3708bbfc)
-7512 b6947af2294ea0c814f5b4cb8737c782895519b2 (719fad14)
-8004 e26f7f19b6c7485f04234946a59ab8f4fd21d6d1 (59127876)
-8826 2512f15446149235156528dafbe75930c712b29e (fc72468e)
[...]
+7042 2512f15446149235156528dafbe75930c712b29e (fc72468e)
+7215 c6c75c93aaeb97bab6fd25b672a641c84dd85d59 (68fe0b8d)
+7391 36438dc19dd2a305dddebd44bf7a65f1a220075b (c424e726)
+7565 1eaabe34fc6f486367a176207420378f587d3b48 (4a27450b)
So the write order differs; one pack stuck 2512f15446 much earlier.
That's probably due to this line from compute_write_order():
/*
* Mark objects that are at the tip of tags.
*/
for_each_tag_ref(mark_tagged, NULL);
If I remove that line, then your manual pack (with --threads=1) gives me
identical packs for each repo.
And if I then mark each with a .keep, then "git repack -ad" to remove
duplicates, your block-dedup check yields:
17742 2
1939 1
which is 90%, and about what I'd expect between those two repos. So I
think the idea of computing a "base" pack (either as a separate pack, or
as a layer in the pack) is a viable strategy.
-Peff
prev parent reply other threads:[~2018-01-25 0:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 22:03 Git packs friendly to block-level deduplication Ævar Arnfjörð Bjarmason
2018-01-24 22:19 ` Mike Hommey
2018-01-24 22:23 ` Junio C Hamano
2018-01-24 22:30 ` Mike Hommey
2018-01-24 22:47 ` Ævar Arnfjörð Bjarmason
2018-01-24 22:25 ` Eric Wong
2018-01-24 22:37 ` Elijah Newren
2018-01-24 23:06 ` Ævar Arnfjörð Bjarmason
2018-01-24 23:32 ` Jeff King
2018-01-24 23:22 ` Jeff King
2018-01-25 0:03 ` Ævar Arnfjörð Bjarmason
2018-01-25 0:10 ` Jeff King
2018-01-25 0:29 ` Jeff King [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180125002942.GA21184@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).