public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff King <peff@peff•net>
To: "brian m. carlson" <sandals@crustytoothpaste•net>
Cc: Martin Fick <mfick@nvidia•com>,
	"git@vger•kernel.org" <git@vger•kernel.org>
Subject: Re: Slow git pack-refs --all
Date: Sat, 27 Dec 2025 02:36:34 -0500	[thread overview]
Message-ID: <20251227073634.GA2071715@coredump.intra.peff.net> (raw)
In-Reply-To: <aU7Cs2pXiXInfBh4@fruit.crustytoothpaste.net>

On Fri, Dec 26, 2025 at 05:15:31PM +0000, brian m. carlson wrote:

> >   If we wanted to be really pedantic, anything in refs/heads/ should not
> >   point to a non-commit and thus should never need to be peeled. I'm not
> >   sure if we want to embed that assumption in this code path, though
> >   (nor would it necessarily help Martin's case if the refs are not in
> >   refs/heads anyway).
> 
> I don't think that would be a good idea.  I know that people definitely
> do updates of the loose refs by hand (although they should not) and so
> it's entirely possible for them to contain invalid values, such as
> having branches contain non-commit objects.

Yeah, that matches my inclination.

> I wonder if reftable would avoid the need for this kind of expensive
> check since it would already have the data peeled if need be and
> wouldn't need to recompute the values.

It does the same amount of peeling, but it's amortized across more
operations (i.e., whatever did those ref updates in the first place)
rather than during the pack operation. And of course there really is no
pack operation per se with reftables, but I believe it avoids re-peeling
when rewriting entries during compaction.

It might actually do fewer object accesses overall if the ref-writing
operations have already loaded the objects in question (and thus it
knows whether they're tags or not, and may even have parsed tags in
memory). It can also do more in some cases (e.g., two loose writes will
peel for each write, whereas the files backend only bothers to peel
during packing).

-Peff

  reply	other threads:[~2025-12-27  7:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-25 22:13 Slow git pack-refs --all Martin Fick
2025-12-25 23:38 ` brian m. carlson
2025-12-26  4:45   ` Jeff King
2025-12-26 17:15     ` brian m. carlson
2025-12-27  7:36       ` Jeff King [this message]
2025-12-31  5:48     ` Martin Fick
2026-01-02  7:49       ` Jeff King
2026-01-05 23:45         ` Martin Fick
2026-01-06  6:53           ` Patrick Steinhardt
2026-01-06 23:02             ` Martin Fick
2026-01-07 11:42               ` Patrick Steinhardt
2026-01-07 22:58                 ` Martin Fick
2026-01-08  6:33                   ` Patrick Steinhardt
2026-01-15 21:09                   ` Jeff King
2026-01-16 20:35                     ` Martin Fick
2026-01-07 17:05             ` Martin Fick
2026-01-06 10:38           ` Jeff King
2026-01-06 23:03             ` Martin Fick
2025-12-31  5:39   ` Martin Fick

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=20251227073634.GA2071715@coredump.intra.peff.net \
    --to=peff@peff$(echo .)net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=mfick@nvidia$(echo .)com \
    --cc=sandals@crustytoothpaste$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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