Skip to content

Commit 2815092

Browse files
author
Johan Tibell
committed
Describe why the Full node exists
1 parent 34c1519 commit 2815092

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/developer-guide.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ Here's a quick overview in order of simplicty:
9393
* `Leaf` -- A key-value pair.
9494
* `Collision` -- An array of key-value pairs where the keys have identical hash
9595
values. Element order doesn't matter.
96-
* `Full` -- An array of child nodes. Given a key you can find the child it is
97-
part of by taking /B/ bits of the hash value for the key and indexing into
96+
* `Full` -- An array of /2^B/ children. Given a key you can find the child it
97+
is part of by taking /B/ bits of the hash value for the key and indexing into
9898
the key. Which bits to use depends on the tree level.
9999
* `BitmapIndexed` -- Similar to above except that the array is implemented as a
100100
sparse array (to avoid storing `Empty` values). A bitmask and popcount is
@@ -106,3 +106,7 @@ The number of bits of the hash value to use at each level of the tree, /B/, is a
106106
compiled time constant (i.e. 4). In general a larger /B/ improves lookup
107107
performance (shallower tree) but hurts modification (large nodes to copy when
108108
updating the spine of the tree).
109+
110+
`Full` is just an optimized version of `BitmapIndexed` that allows us faster
111+
indexing, faster copying on modification (given that its size is statically
112+
know), and lower memory use.

0 commit comments

Comments
 (0)