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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Tuesday, February 10, 2009 - 7:35 pm

On Tue, 10 Feb 2009, Boyd Stephen Smith Jr. wrote:

That sounds unnecessarily complicated. It also really sucks for the case 
you want to optimize: small differences between trees, where you don't 
need to even linearize the common parts.

Why not make it just a straight fixed 12-bit prefix, single-level trie.

Sure, if you have less than 4k objects, it's going to add an unnecessary 
indirection, and close to an extra tree object for each object. But it 
should scale pretty well to a fairly huge numbe of notes. IOW, if you have 
less than 2^24 notes (16 million), you'll never have a tree object with 
more than 4k entries.

And with each tree being ~70 bytes/object (40 bytes name, 20 bytes SHA1 + 
overhead), the individual tree objects will still be a reasonable(ish) 
size. And the fixed depth and prefix size means that merging is trivial 
and can use the normal tree merge that avoids touching common subtrees.

The default .git/objects fan-out of just 8 bits might work too, but if 
we're thinking millions of notes (which is not entirely unreasonable), it 
gets ugly pretty fast. The reason it works ok for git is the repacking.

			Linus
--
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!, 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)