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

Re: Performance regression in connectivity check during receive-pack (git 2.54)

From
Patrick Steinhardt <ps@pks.im>
Date
Jul 22, 2026, 11:49 UTC
Message-ID
<amCuLpT6vYzo1GF8@pks.im>
In-Reply-To
<xmqqtsps76f1.fsf@gitster.g>
On Tue, Jul 21, 2026 at 07:40:02AM -0700, Junio C Hamano wrote:
Show 19 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > Yeah, and that type of regression makes sense for what a593373b09 was
> > trying to do. But I think the v2.54 behavior is wrong. We should check
> > all packs before any loose objects.
> >
> > I'm not sure of the correct fix. This is working against the whole "odb
> > sources are independent and abstract" refactoring that a593373b09 was
> > going for. But I think it's an important optimization. I guess the
> > abstract version would be that each source has "fast" and "slow" lookups
> > or something like that, and we check all fast ones before slow ones. But
> > that is pretty gross.
> >
> > I'll leave it to Patrick to ponder further. I haven't really been paying
> > a lot of attention to the odb refactoring.
> 
> I think checking the fast sources before the slow ones is probably
> the best we can do if we want to retain the 'each odb source is an
> opaque object' abstraction.

Seeing that this is about the `tmp_objdir` case: one of the things that Justin and I wanted to work on anyway is that we want to stop modifying the list of sources during transactions in the first place. It always felt kind of gross that we're modifying the sources when creating a transaction, as the only reason that we do this for is so that the writes actually go to the temporary object directory instead of to the primary object source. And that doesn't make a lot of sense to begin with.

The alternative to this would be to instead have logic in functions like `odb_write()` that checks whether we have an active transaction or not. If so, the write would go into the transaction directly instead of going into the primary source, and consequently we wouldn't even have to modify the list of sources at all.

This shouldn't create too much of a problem, as we typically don't intend to even read objects that we've written into the transaction immediately. It would avoid that we try to read objects from the temporary object directory. And it would also allow us to eventually move all the logic to write objects into the transactions exclusively.

I'm currently out of office though, and will be on vacation next week. I'll explore this area a bit more though once I'm back in office in two weeks.

Patrick
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 13 in “Performance regression in connectivity check during receive-pack (git 2.54)”
  1. Wolfgang KritzingerJul 21, 2026
  2. Jeff KingJul 21, 2026
  3. Taylor BlauJul 21, 2026
  4. Junio C HamanoJul 21, 2026
  5. Patrick SteinhardtJul 22, 2026
  6. Junio C HamanoJul 22, 2026
  7. Jeff KingJul 23, 2026
  8. Patrick SteinhardtJul 24, 2026
  9. Jeff KingJul 26, 2026
  10. Justin ToblerJul 27, 2026
  11. Patrick SteinhardtAug 4, 2026
  12. Jeff KingJul 23, 2026
  13. Jeff KingJul 23, 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.