Re: [PATCH] packfile: fix perf regression with many packs

Jeff King <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
On Thu, Aug 13, 2026 at 10:25:25AM +0200, Johannes Schindelin wrote:

> > > > +test_perf "abbreviate with 10,000 packs" '
> > > > +	git rev-parse --short HEAD
> > > > +'
> > 
> > ...I wonder what value this is adding. It shows the same slowdown as the
> > existing test you can see in the context (and whose results I showed
> > above).
> 
> I do think that there is value in adding this. It not only directly
> reflects what GIT_PS1 runs, but it also exercises a subtly different path:
> `--short` has to look for the unique abbreviation, whereas `--verify` can
> stop as soon as it found the OID already.

Yes, though the regression your patch fixes is about creating the
initial pack list, so it happens whether we open each pack or not.

We do test multiple cases earlier in the file where we look at each
object (both a stock rev-list, and one where we abbreviate, looking for
perf problems in the shortening code itself). But we only do that for
1/50/1000 packs, not the big 10,000 pack case.

I dunno. It probably is not hurting much to have some redundancy in the
tests because this one in particular is not too expensive to run. So I
am OK either way.

-Peff
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.