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

Re: [RFC] On watchman support

From
Jeff King <peff@peff.net>
Date
Nov 19, 2014, 01:46 UTC
Message-ID
<20141119014600.GA2337@peff.net>
In-Reply-To
<xmqqwq6std27.fsf@gitster.dls.corp.google.com>
On Tue, Nov 18, 2014 at 01:26:56PM -0800, Junio C Hamano wrote:
Show 5 quoted lines
> It is not check_refname_format() that is the real problem. It's the
> fact that we do O(# of refs) work whenever we have to access the
> packed-refs file. check_refname_format() is part of that, surely,
> but so is reading the file, creating all of the refname structs in
> memory, etc. (credit to peff@).

Yeah, I'd agree very much with that. I am not sure if I am cc'd here because of my general complaining about packed-refs, or if I have said something clever on the subject.

I did implement at one point a packed-refs reader that does a binary search on the mmap'd packed-refs file, and can return a single value or even locate the first entry matching a prefix (like "refs/tags/") and iterate until we're out of the prefix. Unfortunately this runs very contrary to the caching design of the refs.c code. It is focused on caching _loose_ refs, where we may read an outer directory (like "refs/"), and would like to avoid descending into an inner directory (likes "refs/foo/") unless we are interested in what is in it. But caching partial reads of packed-refs like this is "inside out"; we might read all of "refs/tags/*", but have no clue what else is in "refs/". So integrating it into refs.c would take pretty major surgery.

-Peff
Previous: Junio C HamanoNext: Duy Nguyen
Message 11 of 15 in “[RFC] On watchman support”
  1. Duy NguyenNov 11, 2014
  2. Torsten BögershausenNov 13, 2014
  3. Duy NguyenNov 13, 2014
  4. Torsten BögershausenNov 15, 2014
  5. David TurnerNov 18, 2014
  6. Duy NguyenNov 18, 2014
  7. David TurnerNov 18, 2014
  8. Junio C HamanoNov 18, 2014
  9. David TurnerNov 18, 2014
  10. Junio C HamanoNov 18, 2014
  11. Jeff KingNov 19, 2014
  12. Duy NguyenNov 28, 2014
  13. David TurnerDec 1, 2014
  14. Paolo CiarrocchiNov 19, 2014
  15. David TurnerNov 19, 2014

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.