Skip to content

KV leaf node memory optimization

Compare
Choose a tag to compare
@C-Pro C-Pro released this 04 Nov 09:01
· 13 commits to main since this release
4f6a084

Optimization to store leaf nodes as single node with multi-byte suffix instead of a set of single-byte nodes to optimize both memory consumption (about 50x less memory used for long keys) as well as CPU usage reduction due to less iterations needed to reach terminal node.

For example before optimization keys "apple" and "approve" were stored this way (one node per character):

a - p - p - l - e
        |
        r - o - v - e

After "tail aggregation" the suffix parts of both keys can be aggregated in the single node:

a - p - p - le
        |
        rove