Chunked LPM Tree #195
GeorgyKirichenko
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation
LPM tree is not truly dynamically extensible.
During LPM tree initialization the tree assumes some capacity value large enough to accommodate all the values and allocates continuous block of memory to fit all chunks inside.
The in case of space underestimation the tree doubles the space and tries to reinsert all incoming values again, and so on, until all values would fit into.
Any internal chunk is addressable by an identifier which is effectively an offset of the chunk inside allocated memory.
Suggested design
Two level chunk addressation: consider the chunk identifier as an extent identifier and index of the chunk inside the extent.
This means that we can dynamically allocate an extent and attach them to a LPM tree. However this requires for an additional index array storing an extent address by it's identifier.
Considerations about the extent index size:
Now we have 24 bits for both value and chunk identifier stored in a 4-byte value, then if an extent contains 2^C chunks we will have
For an example if we choose C=10 then the resulting values will be equal
Beta Was this translation helpful? Give feedback.
All reactions