git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Performance regression in "update" hooks

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 2, 2026, 14:27 UTC
Message-ID
<aaWeSu-d1FMz_sW8@pks.im>
In-Reply-To
<874imy7220.fsf@collabora.com>
On Mon, Mar 02, 2026 at 04:12:39PM +0200, Adrian Ratiu wrote:
Show 44 quoted lines
> On Mon, 02 Mar 2026, Adrian Ratiu <adrian.ratiu@collabora.com> wrote:
> > On Mon, 02 Mar 2026, Patrick Steinhardt <ps@pks.im> wrote:
> >> Hi,
> >>
> >> Bencher has alerted me that there's been two performance regressions in
> >> git-receive-pack(1) [1] and git-fetch(1) [2].
> >>
> >> The first one is quite easy to reproduce with the benchmarks at [3] and
> >> bisects to fc148b146a (receive-pack: convert update hooks to new API,
> >> 2026-01-28):
> >>
> >>   $ cd receive-refs
> >>   $ ./run --revisions /path/to/your/git/repo \
> >>       fc148b146ad41be71a7852c4867f0773cbfe1ff9~,fc148b146ad41be71a7852c4867f0773cbfe1ff9 \
> >>       --parameter-list refformat reftable \
> >>       --parameter-list refcount 10000
> >>
> >>   Benchmark 1: receive: many refs (refformat = reftable, refcount = 10000, revision = fc148b146ad41be71a7852c4867f0773cbfe1ff9~)
> >>     Time (mean ± σ):     182.0 ms ±   2.7 ms    [User: 91.5 ms, System: 89.3 ms]
> >>     Range (min … max):   175.8 ms … 185.0 ms    15 runs
> >>
> >>   Benchmark 2: receive: many refs (refformat = reftable, refcount = 10000, revision = fc148b146ad41be71a7852c4867f0773cbfe1ff9)
> >>     Time (mean ± σ):     484.6 ms ±  27.6 ms    [User: 176.2 ms, System: 376.1 ms]
> >>     Range (min … max):   406.2 ms … 495.1 ms    10 runs
> >>
> >>   Summary
> >>     receive: many refs (refformat = reftable, refcount = 10000, revision = fc148b146ad41be71a7852c4867f0773cbfe1ff9~) ran
> >>       2.66 ± 0.16 times faster than receive: many refs (refformat = reftable, refcount = 10000, revision = fc148b146ad41be71a7852c4867f0773cbfe1ff9)
> >>
> >> I've Cc'd Adrian.
> >
> > Hi Patrick,
> >
> > I looked at the commits before and after the many-refs test regression
> > and it appears the regressions started after Junio landed v2 of the
> > config series in next [1], which might cause it.
> >
> > v2 was not ready to land. I sent v3 yesterday addressing all the
> > feedback, didn't even realize v2 landed. :)
> >
> > Does the regression go away if you revert [1] ?
> >
> > I don't have the benchmark setup and it might be easier for you to
> > confirm?

All you need is a normal development infra and hyperfine. The benchmarking scripts in the repo I linked should then "just work" with the above invocation.

[snip]
> Actually I think these are two separate issues.
> 
> I will reproduce and look into the regression which bisected to
> c148b146a (receive-pack: convert update hooks to new API,  2026-01-28).
Perfect, thanks!
Patrick
Previous: Adrian RatiuNext: Jeff King
Message 4 of 7 in “Performance regression in "update" hooks”
  1. Patrick SteinhardtMar 2, 2026
  2. Adrian RatiuMar 2, 2026
  3. Adrian RatiuMar 2, 2026
  4. Patrick SteinhardtMar 2, 2026
  5. Jeff KingMar 2, 2026
  6. Adrian RatiuMar 2, 2026
  7. Junio C HamanoMar 2, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.