Expand description
Summary: Object pool for B+ tree nodes. Copyright (c) YOAB. All rights reserved.
This module provides an object pool for B+ tree leaf and branch nodes. Instead of allocating new nodes for every insert and deallocating on every delete, nodes are recycled through the pool.
§Design
- Maintains separate pools for leaf and branch nodes
- Released nodes are cleared before being returned to pool
- Pool has configurable maximum size to bound memory usage
- Statistics track hit/miss rates for monitoring
§Security
Nodes are cleared when released to prevent data leakage. This ensures that sensitive key/value data from one transaction cannot leak to subsequent transactions through reused nodes.
§Performance
- Pool hit: O(1) node acquisition
- Pool miss: O(1) allocation (standard heap allocation)
- Release: O(n) where n is keys in node (due to clearing)
Structs§
- Node
Pool - Object pool for B+ tree nodes.
- Pool
Stats - Statistics for the node pool.
- Pooled
Branch Node - A branch node for the B+ tree.
- Pooled
Leaf Node - A leaf node for the B+ tree.
Constants§
- DEFAULT_
MAX_ POOLED - Default maximum number of nodes to keep in each pool.