Skip to content

Prepare for expanding the number of inner node types#64

Merged
declanvk merged 4 commits intomainfrom
generic-n48
Sep 23, 2025
Merged

Prepare for expanding the number of inner node types#64
declanvk merged 4 commits intomainfrom
generic-n48

Conversation

@declanvk
Copy link
Owner

  • Add new crate for analyzing key distributions
  • Move leaf node to own module
  • Rename inner node types
  • Move "read full prefix" out of header module

**Description**
 Add `blart-analysis` crate with some logic for analyzing key
 distributions and optimizing inner node width assignments.

**Motivation**
I'd like to test out possible performance gains when optimizing the
tree representation for specific key distributions.

**Testing Done**
Unit tests, ran:
```bash
cargo run --release --\
    --timing   \
    /home/declan/repos/github/learnedsystems/SOSD/data/books_200M_uint64
```
**Motivation**
The `representation.rs` file is pretty large and it is difficult to read
at times, this change makes that slightly better.
**Description**
 - `InnerNodeCompressed` -> `InnerNodeSorted`
 - `InnerNode48` -> `InnerNodeIndirect`
 - `InnerNode256` -> `InnerNodeDirect`
 - Also make `InnerNode48` generic over number of children

**Motivation**
Renamed the inner node types to focus on their method of lookup, as
opposed to the number of child nodes they could contain.

Also made `InnerNodeIndirect` to be generic over the number of children
so it could be expanded in the future.

**Testing Done**
`./scripts/full-test.sh nightly`
**Description**
Also simplify some of `ltrim_by_with_leaf` code since it was redundant.

**Motivation**
The `inner_read_full_prefix` function didn't really belong in the header
module, since it was mostly concerned with traversing the tree and
reading from a descendant leaf node.

**Testing Done**
`./scripts/full-test.sh nightly`
@declanvk declanvk closed this Sep 23, 2025
@declanvk declanvk reopened this Sep 23, 2025
@declanvk declanvk changed the title generic n48 Prepare for expanding the number of inner node types Sep 23, 2025
@declanvk declanvk merged commit a3fb0b9 into main Sep 23, 2025
8 checks passed
@declanvk declanvk deleted the generic-n48 branch September 23, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant