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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeff King
Date: Tuesday, February 10, 2009 - 6:16 am

On Tue, Feb 10, 2009 at 01:58:41AM -0600, Boyd Stephen Smith Jr. wrote:


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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
RFC: Flat directory for notes, or fan-out? Both!, Johannes Schindelin, (Mon Feb 9, 2:12 pm)
Re: [PATCH] git-rebase-interactive: you can also add new c ..., Johannes Schindelin, (Mon Feb 9, 2:31 pm)
Re: [PATCH] git-rebase-interactive: you can also add new c ..., Johannes Schindelin, (Mon Feb 9, 3:26 pm)
Re: RFC: Flat directory for notes, or fan-out? Both!, Boyd Stephen Smith Jr., (Tue Feb 10, 12:58 am)
Re: RFC: Flat directory for notes, or fan-out? Both!, Johannes Schindelin, (Tue Feb 10, 5:59 am)
Re: RFC: Flat directory for notes, or fan-out? Both!, Jeff King, (Tue Feb 10, 6:16 am)
Re: RFC: Flat directory for notes, or fan-out? Both!, Johannes Schindelin, (Tue Feb 10, 6:32 am)
Re: RFC: Flat directory for notes, or fan-out? Both!, Shawn O. Pearce, (Tue Feb 10, 9:44 am)
Re: RFC: Flat directory for notes, or fan-out? Both!, Johannes Schindelin, (Tue Feb 10, 10:09 am)
Re: RFC: Flat directory for notes, or fan-out? Both!, Shawn O. Pearce, (Tue Feb 10, 10:17 am)
Re: RFC: Flat directory for notes, or fan-out? Both!, Sam Vilain, (Tue Feb 10, 6:14 pm)
Re: RFC: Flat directory for notes, or fan-out? Both!, Boyd Stephen Smith Jr., (Tue Feb 10, 6:58 pm)
Re: RFC: Flat directory for notes, or fan-out? Both!, Linus Torvalds, (Tue Feb 10, 7:35 pm)
Re: RFC: Flat directory for notes, or fan-out? Both!, Sam Vilain, (Tue Feb 10, 8:19 pm)
Re: RFC: Flat directory for notes, or fan-out? Both!, Sam Vilain, (Tue Feb 10, 8:30 pm)
Re: RFC: Flat directory for notes, or fan-out? Both!, Linus Torvalds, (Tue Feb 10, 8:54 pm)
Re: RFC: Flat directory for notes, or fan-out? Both!, Sam Vilain, (Tue Feb 10, 10:05 pm)
Re: RFC: Flat directory for notes, or fan-out? Both!, Johannes Schindelin, (Wed Feb 11, 5:35 am)