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

Re: "git notes show" is orders of magnitude slower than doing it manually with ls-tree and cat-file

From
Jeff King <peff@peff.net>
Date
Nov 26, 2014, 04:49 UTC
Message-ID
<20141126044935.GB15252@peff.net>
In-Reply-To
<20141126023039.GA19401@glandium.org>
On Wed, Nov 26, 2014 at 11:30:39AM +0900, Mike Hommey wrote:
Show 6 quoted lines
> > Hmph. Having just written all that, I looked at your example again, and
> > you are running "git ls-tree -r", which would read the whole tree
> > anyway. So "git notes" should be _faster_ for a single lookup.
> 
> The -r actually doesn't matter, since what's being listed is a blob, not
> a tree, so there is no recursion.

Ah, right. I should have looked more carefully. I took the "-r" and the patterns to mean "recursively list the tree, and I will grep for these elements". But you were actually generating a set of pathspecs, which git could then use to limit some of the walk.

-Peff
Previous: Mike HommeyNext: Mike Hommey
Message 6 of 10 in “"git notes show" is orders of magnitude slower than doing it manually with ls-tree and cat-file”
  1. Mike HommeyNov 26, 2014
  2. Jeff KingNov 26, 2014
  3. Jeff KingNov 26, 2014
  4. Jeff KingNov 26, 2014
  5. Mike HommeyNov 26, 2014
  6. Jeff KingNov 26, 2014
  7. Mike HommeyNov 26, 2014
  8. Jeff KingNov 26, 2014
  9. Johan HerlandNov 26, 2014
  10. Mike HommeyNov 26, 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.