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

Re: RFC: Flat directory for notes, or fan-out? Both!

From
Jeff King <peff@peff.net>
Date
Feb 10, 2009, 13:16 UTC
Message-ID
<20090210131600.GD17305@coredump.intra.peff.net>
In-Reply-To
<200902100158.46884.bss@iguanasuicide.net>
On Tue, Feb 10, 2009 at 01:58:41AM -0600, Boyd Stephen Smith Jr. wrote:
Show 7 quoted lines
> On Monday 09 February 2009 15:12:06 Johannes Schindelin wrote:
> > So I think it would be a sane plan to do the following when a commit note
> > is requested:
> 
> So, something like a Trie data structure?  I think that is a great way to 
> store fixed-length strings from a limited alphabet with arbitrary data 
> attached.

I don't think a Trie quite makes sense here. We still have to look linearly through each git tree (an artifact of the tree implementation).

You could organize the tree into a deeper, more complex data structure than just a simple fan-out. But remember that traditional data structures are usually trying to save expensive comparisons, and following a pointer is inexpensive. In the case of git trees, though, following a pointer into a subtree is _very_ expensive, since you have to lookup and decompress the object.

So what we do now is read the tree into an associative hash. You could replace the hash with a trie, but it is not really the performance-critical part here. The issue is that without fan-out you have to read the _whole_ tree into the hash. With a constant-sized fanout, you get to divide that work by a constant.

Or did you mean something else entirely?
-Peff
Previous: Boyd Stephen Smith Jr.Next: Boyd Stephen Smith Jr.
Message 3 of 33 in “RFC: Flat directory for notes, or fan-out? Both!”
  1. Johannes SchindelinFeb 9, 2009
  2. Boyd Stephen Smith Jr.Feb 10, 2009
  3. Jeff KingFeb 10, 2009
  4. Boyd Stephen Smith Jr.Feb 11, 2009
  5. Linus TorvaldsFeb 11, 2009
  6. Sam VilainFeb 11, 2009
  7. Linus TorvaldsFeb 11, 2009
  8. Sam VilainFeb 11, 2009
  9. Johannes SchindelinFeb 11, 2009
  10. Jeff KingFeb 10, 2009
  11. Johannes SchindelinFeb 10, 2009
  12. Jeff KingFeb 10, 2009
  13. Johannes SchindelinFeb 10, 2009
  14. Junio C HamanoFeb 10, 2009
  15. Shawn O. PearceFeb 10, 2009
  16. Johannes SchindelinFeb 10, 2009
  17. Shawn O. PearceFeb 10, 2009
  18. Johannes SchindelinFeb 10, 2009
  19. Junio C HamanoFeb 10, 2009
  20. Shawn O. PearceFeb 10, 2009
  21. Johannes SchindelinFeb 10, 2009
  22. Thomas RastFeb 10, 2009
  23. Thomas RastFeb 10, 2009
  24. Junio C HamanoFeb 10, 2009
  25. Jeff KingFeb 11, 2009
  26. Johannes SchindelinFeb 11, 2009
  27. Junio C HamanoFeb 11, 2009
  28. Johannes SchindelinFeb 11, 2009
  29. Shawn O. PearceFeb 10, 2009
  30. Johannes SchindelinFeb 10, 2009
  31. Shawn O. PearceFeb 10, 2009
  32. Sam VilainFeb 11, 2009
  33. Sam VilainFeb 11, 2009

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.