]> source.dussan.org Git - jgit.git/commit
Lazy load note subtrees from fanout levels 49/1849/4
authorShawn O. Pearce <spearce@spearce.org>
Fri, 5 Nov 2010 01:23:40 +0000 (18:23 -0700)
committerChris Aniszczyk <caniszczyk@gmail.com>
Thu, 11 Nov 2010 16:23:38 +0000 (10:23 -0600)
commitb81b97fbddaab4bc2615fea5301f3eb39e3b03bd
tree6eb452d7841e9a26cc55de243154dc26ec82f0ac
parent936820988fa9e46c358af7971806faa6515546f6
Lazy load note subtrees from fanout levels

Instead of reading a note tree recursively up front when the NoteMap
is loaded, read only the root tree and load subtrees on demand when
they are accessed by the application.  This gives a lower latency
to read a note for the recent commits on a branch, as only the paths
that are needed get read.

Given a 2/38 style fanout, the tree will fully load when 256 objects
have been accessed by the application.  But unlike the prior version
of NoteMap, the NoteMap will load faster and answer lookups sooner,
as the loading time for all 256 levels is spread out across each of
the get() requests.

Given a 2/2/36 style fanout, the tree won't need to fully load until
about 65,536 objects are accessed.

To simplify the implementation we only support the flat layout (all
notes in the top level tree), or a 2/38, 2/2/36, 2/2/2/34, through
2/.../2 style fanout.  Unlike C Git we don't support reading the old
experimental 4/36 fanout.  This is sufficient because C Git won't
create the 4/36 style fanout when creating or updating a notes tree,
and there really aren't any in the wild today.

Change-Id: I6099b35916a8404762f31e9c11f632e43e0c1bfd
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/notes/InMemoryNoteBucket.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/notes/LeafBucket.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteBucket.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java
org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteParser.java [new file with mode: 0644]