git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Derrick Stolee <stolee@gmail.com>
Cc: git@vger.kernel.org, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [PATCH] pack-objects: avoid pointless oe_map_new_pack() calls
Date: Mon, 11 Nov 2019 09:28:00 -0500	[thread overview]
Message-ID: <20191111142800.GA1934@sigill.intra.peff.net> (raw)
In-Reply-To: <01605e2d-5ea7-037d-b25f-3774b88d059d@gmail.com>

On Mon, Nov 11, 2019 at 08:42:47AM -0500, Derrick Stolee wrote:

> > The current test in p5303 sadly doesn't notice this problem, since it
> > maxes out at 1000 packs. If we add a new test to it at 2000 packs, it
> > does show the improvement:
> > 
> >   Test                      HEAD^               HEAD
> >   ----------------------------------------------------------------------
> >   5303.12: repack (2000)    26.72(39.68+0.67)   15.70(28.70+0.66) -41.2%
> 
> And these numbers don't really show a quadratic improvement, probably due
> to the test itself needing to do the work to create 2000 packs.

No, the 2000-pack setup happens in a separate (untimed) test.

The reason this improvement is less extreme is that we're only hitting
the extra oe_map_new_pack() call for a subset of the objects. The first
1023 packs have an index field (and because of the way we generate the
packs, I think that includes the "big" initial pack), so not every
object triggers the problem.

This was spurred by a couple of real cases where maintenance had fallen
behind and we had accrued a lot of packs (and of course we wanted to
repack to get out of the bad situation, which became a chicken and egg).
One of those real-world cases with 15,000 packs dropped from ~11 hours
to ~5 minutes.

I'm actually amazed we didn't notice this before (the problem started in
v2.18, which we deployed at GitHub over a year ago). But we try to avoid
ending up with that many packs in the first place, and even when we did,
automated maintenance _usually_ dug them out by itself if you were
patient enough.

> Reviewed-by: Derrick Stolee <dstolee@microsoft.com>

Thanks!

-Peff

      reply	other threads:[~2019-11-11 14:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-11 11:12 [PATCH] pack-objects: avoid pointless oe_map_new_pack() calls Jeff King
2019-11-11 13:42 ` Derrick Stolee
2019-11-11 14:28   ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191111142800.GA1934@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=stolee@gmail.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.
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).