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

Re: [BUG] "git describe --match" performance

From
Jeff King <peff@peff.net>
Date
Oct 31, 2024, 17:05 UTC
Message-ID
<20241031170526.GA2277590@coredump.intra.peff.net>
In-Reply-To
<20241031162522.3qcolxhgxe4g2zmu@jpoimboe>
On Thu, Oct 31, 2024 at 09:25:22AM -0700, Josh Poimboeuf wrote:
> But my real development repo, which has many branches and remotes plus
> the historical git repo grafted, still takes 10+ seconds.

If grafts are present, the use of the commit-graph is disabled, because the point of the commit-graph is precomputing and caching various properties of commits. Which, absent grafting, are immutable.

I think we talked long ago about computing commit-graphs over the grafted state, and then using those graphs as long as the graft state remained the same. But I don't think we ever implemented anything.

Another possibility (that I don't recall we've ever discussed) is partially using commit graphs. Some commit properties, like generation numbers, depend on other commits. So a graft at the bottom of history is going to rewrite the generations for all of the descendants. But we could still use the graph information to load the parents and trees of all of the non-grafted commits. Those are still valid even in a grafted situation, and that's what's providing most of the speed up in this case (without it, we're literally zlib inflating each commit we traverse in order to find its parents, versus an integer lookup via the commit-graph).

That might not be _too_ hard to implement. In theory, anyway. :)
Show 22 quoted lines
> Note the commit it finishes at is from almost 20 years ago (I have
> historical Linux git history grafted in which goes back to 1991):
> 
> commit d8470b7c13e11c18cf14a7e3180f0b00e715e4f0
> Author: Karsten Keil <kkeil@suse.de>
> Date:   Thu Apr 21 08:30:30 2005 -0700
> 
>     [PATCH] fix for ISDN ippp filtering
> 
>     We do not longer use DLT_LINUX_SLL for activ/pass filters but
>     DLT_PPP_WITHDIRECTION witch need 1 as outbound flag.
> 
>     Signed-off-by: Karsten Keil <kkeil@suse.de>
>     Signed-off-by: Linus Torvalds <torvalds@osdl.org>
> 
> 
> Presumably only one candidate matches the "v6.12-rc5" glob (which is an
> exact string, not a wildcard) so it tries to find 9 more but never finds
> any?
> 
> Since it's not a wildcard pattern, I would expect it to stop immediately
> when it reaches the exact match.
Yeah, I think this is just the same issue we've been discussing.
-Peff
Previous: Josh PoimboeufNext: Taylor Blau
Message 6 of 10 in “[BUG] "git describe --match" performance”
  1. Josh PoimboeufOct 30, 2024
  2. Jeff KingOct 31, 2024
  3. Josh PoimboeufOct 31, 2024
  4. Jeff KingOct 31, 2024
  5. Josh PoimboeufOct 31, 2024
  6. Jeff KingOct 31, 2024
  7. Taylor BlauOct 31, 2024
  8. Kristoffer HaugsbakkOct 31, 2024
  9. Jeff KingOct 31, 2024
  10. Taylor BlauOct 31, 2024

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.