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

Re: [PATCH 0/5] tree-walk object_id refactor

From
Jeff King <peff@peff.net>
Date
Jan 11, 2019, 14:17 UTC
Message-ID
<20190111141753.GA16754@sigill.intra.peff.net>
In-Reply-To
<20190111001750.GO423984@genre.crustytoothpaste.net>
On Fri, Jan 11, 2019 at 12:17:50AM +0000, brian m. carlson wrote:
Show 9 quoted lines
> > I think this is really the only safe and sane solution. We resisted it
> > because of the cost of the extra copies (especially the
> > update_tree_entry() one). But I don't know that anybody actually
> > measured it. Do you have any performance numbers before/after this
> > series?
> 
> Unfortunately, I don't. I'm not really sure in what situations we hit
> this code path a lot, so I'm not sure what exactly we should performance
> test. If you have suggestions, I can set up some perf tests.

I think the interesting one here is the copy in update_tree_entry(), which is called for every entry of every tree we parse for a diff. So the command with the most noticeable impact, I think, would be something like:

  git log -- pathspec

I couldn't demonstrate any measurable slowdown (I didn't compute the mean to see if it gets worse, but certainly any change is within the run-to-run noise).

I guess that is competing with the cost to access the commit objects. Perhaps a pure tree diff would be a more precise test. Here's the most pathological case I could come up with:

  git init
  for i in $(seq 10000); do echo $i >$i; done
  git add .
  git commit -m base
  echo change >9999
  git commit -am change
  time git diff-tree HEAD^ HEAD

which should really be spending 99% of its time inflating and walking through the trees. And even there I couldn't measure anything.

So I'd say it's probably fine.
-Peff
Previous: brian m. carlsonNext: brian m. carlson
Message 30 of 41 in “What's cooking in git.git (Jan 2019, #01; Mon, 7)”
  1. Junio C HamanoJan 7, 2019
  2. tg/checkout-no-overlay, was Re: What's cooking in git.git (Jan 2019, #01; Mon, 7)Thomas Gummerer, Jan 8, 2019
  3. Junio C HamanoJan 8, 2019
  4. ag/sequencer-reduce-rewriting-todo Re: What's cooking in git.git (Jan 2019, #01; Mon, 7)Alban Gruin, Jan 8, 2019
  5. sb/more-repo-in-api, was Re: What's cooking in git.git (Jan 2019, #01; Mon, 7)Jonathan Tan, Jan 8, 2019
  6. Junio C HamanoJan 8, 2019
  7. Stefan BellerJan 9, 2019
  8. Martin ÅgrenJan 9, 2019
  9. Martin ÅgrenJan 9, 2019
  10. brian m. carlsonJan 10, 2019
  11. Junio C HamanoJan 10, 2019
  12. Martin ÅgrenJan 10, 2019
  13. 0/5 tree-walk object_id refactorbrian m. carlson, Jan 10, 2019
  14. 1/5 tree-walk: copy object ID before usebrian m. carlson, Jan 10, 2019
  15. 2/5 match-trees: compute buffer offset correctly when splicingbrian m. carlson, Jan 10, 2019
  16. 3/5 match-trees: use hashcpy to splice treesbrian m. carlson, Jan 10, 2019
  17. Jeff KingJan 10, 2019
  18. brian m. carlsonJan 10, 2019
  19. Jeff KingJan 11, 2019
  20. Jeff KingJan 11, 2019
  21. brian m. carlsonJan 14, 2019
  22. Jeff KingJan 14, 2019
  23. 4/5 tree-walk: store object_id in a separate memberbrian m. carlson, Jan 10, 2019
  24. Jeff KingJan 10, 2019
  25. brian m. carlsonJan 10, 2019
  26. 5/5 cache: make oidcpy always copy GIT_MAX_RAWSZ bytesbrian m. carlson, Jan 10, 2019
  27. Jeff KingJan 10, 2019
  28. Jeff KingJan 10, 2019
  29. brian m. carlsonJan 11, 2019
  30. Jeff KingJan 11, 2019
  31. 0/5 tree-walk object_id refactorbrian m. carlson, Jan 15, 2019
  32. 1/5 tree-walk: copy object ID before usebrian m. carlson, Jan 15, 2019
  33. 2/5 match-trees: compute buffer offset correctly when splicingbrian m. carlson, Jan 15, 2019
  34. 4/5 tree-walk: store object_id in a separate memberbrian m. carlson, Jan 15, 2019
  35. 5/5 cache: make oidcpy always copy GIT_MAX_RAWSZ bytesbrian m. carlson, Jan 15, 2019
  36. 3/5 match-trees: use hashcpy to splice treesbrian m. carlson, Jan 15, 2019
  37. Junio C HamanoJan 15, 2019
  38. Jeff KingJan 9, 2019
  39. Junio C HamanoJan 10, 2019
  40. Junio C HamanoJan 10, 2019
  41. Stefan BellerJan 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.