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, 11:47 UTC
Message-ID
<20241031114731.GA608553@coredump.intra.peff.net>
In-Reply-To
<20241030044322.b5n3ji2n6gaeo5u6@treble.attlocal.net>
On Tue, Oct 29, 2024 at 09:43:22PM -0700, Josh Poimboeuf wrote:
Show 18 quoted lines
> $ time git describe --match=v6.10-rc7 --debug
> describe HEAD
> No exact match on refs or tags, searching to describe
> finished search at d8470b7c13e11c18cf14a7e3180f0b00e715e4f0
>  annotated       1844 v6.10-rc7
> traversed 1282750 commits
> v6.10-rc7-1844-gc61e41121036
> 
> real	0m9.243s
> user	0m8.940s
> sys	0m0.268s
> 
> $ time git describe
> v6.10-rc7-1844-gc61e41121036
> 
> real	0m0.149s
> user	0m0.111s
> sys	0m0.036s

There's more discussion of the actual solution in the nearby thread from Rasmus. But I did want to note one thing here: when I initially tried to reproduce your problem, my "slow" case was a lot less bad.

The reason is that I had a commit graph file to speed up traversal. So independent of the git-describe fix, you might want to try:

  git commit-graph write --reachable

That reduces the slow case for me by a factor of 10. And likewise other traversal operations should get faster.

I think we'll build the commit graph file by default these days when you run "git gc". But we don't build it immediately after cloning. Perhaps we should change that.

-Peff
Previous: Josh PoimboeufNext: Josh Poimboeuf
Message 2 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.