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

Re: [PATCH v2] cache-tree: do not lazy-fetch merge tree

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 10, 2019, 01:09 UTC
Message-ID
<xmqqwoehgdnk.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190909222101.GB31319@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I wondered also if this means we should be using OBJECT_INFO_QUICK.
> I.e., do we expect to see a "miss" here often, forcing us to re-scan the
> packed directory?

As a performance optimization hack, it is OK if we did not notice that the tree object, which corresponds to what is currently prepared for a directory in the index, does exist in the object store. It is not worth rescanning the packs to "protect" against races, I think, in the "repair" codepath.

When the user actually wants to write the index out as a tree, we would write it out as a loose object (or omit doing so if we know there are already copies), but because it is not a crime to create a duplicate loose object when we already have a packed copy, I do not think we need to rescan in that context, either. But I do not think the codepath Jonathan's patch touches is about that operation.

Previous: Jeff KingNext: Jonathan Tan
Message 9 of 12 in “cache-tree: do not lazy-fetch merge tree”
  1. cache-tree: do not lazy-fetch merge treeJonathan Tan, Sep 3, 2019
  2. Derrick StoleeSep 4, 2019
  3. Jonathan TanSep 4, 2019
  4. Junio C HamanoSep 4, 2019
  5. cache-tree: do not lazy-fetch merge treeJonathan Tan, Sep 9, 2019
  6. Junio C HamanoSep 9, 2019
  7. Junio C HamanoSep 9, 2019
  8. Jeff KingSep 9, 2019
  9. Junio C HamanoSep 10, 2019
  10. Jonathan TanSep 10, 2019
  11. SZEDER GáborSep 10, 2019
  12. Jonathan TanSep 10, 2019

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.