From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Nicolas Pitre <nico@fluxnic.net>,
Jay Soffian <jaysoffian@gmail.com>,
Junio C Hamano <gitster@pobox.com>,
Shawn Pearce <spearce@spearce.org>
Subject: Re: gc --aggressive
Date: Sat, 28 Apr 2012 08:25:33 -0400 [thread overview]
Message-ID: <20120428122533.GA12098@sigill.intra.peff.net> (raw)
In-Reply-To: <vpqbomqqdxo.fsf@bauges.imag.fr>
On Tue, Apr 17, 2012 at 10:52:03PM +0200, Matthieu Moy wrote:
> Jay Soffian <jaysoffian@gmail.com> writes:
>
> > + 3. `git gc --aggressive`; this is often much slower than (2) because git
> > + throws out all of the existing deltas and recomputes them from
> > + scratch. It uses a higher window parameter meaning it will spend
> > + more time computing, and it may end up with a smaller pack. However,
> > + unless the repository is known to have initially been poorly packed,
> > + this option is not needed and will just cause git to perform
> > + extra work.
>
> I like your patch.
>
> Maybe you should elaborate on "unless the repository is known to have
> initially been poorly packed". My understanding is that --aggressive was
> implemented to be called after an import from another VCS that would
> have computed very poor deltas, but I'm not sure about the details.
Coincidentally, I came across a case last week that shows --aggressive
providing a large improvement. And it's a public repo, so I was able to
grab a snapshot of the pre-packed state to experiment on and share.
The current packfile is ~246M. It was produced over time by pushes into
the repository, which were then eventually grouped into a single pack by
"git gc" (I'm not sure of the exact history, but this may even have been
a set of "gc --auto" calls over time).
Here's a list of commands and the pack sizes they yield on the repo:
1. `git repack -ad`: 246M
2. `git repack -ad -f`: 376M
3. `git repack -ad --window=250`: 246M
4. `git repack -ad -f --window=250`: 145M
The most interesting thing is (4): repacking with a larger window size
yields a 100M (40%) space improvement. The other commands show that it
is not that the current pack is simply bad; command (2) repacks from
scratch and actually ends up with a worse pack. So the increased window
size really is important.
I haven't been able to figure out what it is about this dataset that
makes the bigger window so much better. Certainly doing the same
commands on git.git does not yield as impressive a speedup.
If anybody is interested in the repository as a packing test case, you
can download it from:
https://gist.github.com/raw/2518074/d9c0244bf0ced690fee1edb2c88c522ecce102e4/phpmyadmin-network.tar
-Peff
next prev parent reply other threads:[~2012-04-28 12:26 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 16:16 gc --aggressive Jay Soffian
2012-04-17 17:53 ` Jay Soffian
2012-04-17 20:52 ` Matthieu Moy
2012-04-17 21:58 ` Jeff King
2012-04-28 12:25 ` Jeff King [this message]
2012-04-28 17:11 ` Nicolas Pitre
2012-04-29 11:34 ` Jeff King
2012-04-29 13:53 ` Nicolas Pitre
2012-05-01 16:28 ` Jeff King
2012-05-01 17:16 ` Jeff King
2012-05-01 17:59 ` Nicolas Pitre
2012-05-01 18:47 ` Junio C Hamano
2012-05-01 19:22 ` Nicolas Pitre
2012-05-01 20:01 ` Jeff King
2012-05-01 19:35 ` Jeff King
2012-05-01 20:02 ` Nicolas Pitre
2012-05-01 17:17 ` Nicolas Pitre
2012-05-01 17:22 ` Jeff King
2012-05-01 17:47 ` Nicolas Pitre
2012-04-28 16:56 ` Nicolas Pitre
2012-04-17 22:08 ` Jeff King
2012-04-17 22:17 ` Junio C Hamano
2012-04-17 22:18 ` Jeff King
2012-04-17 22:34 ` Junio C Hamano
2012-04-28 16:42 ` Nicolas Pitre
2012-04-18 8:49 ` Andreas Ericsson
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=20120428122533.GA12098@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jaysoffian@gmail.com \
--cc=nico@fluxnic.net \
--cc=spearce@spearce.org \
/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 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 NNTP newsgroup(s).