Skip to content

Conversation

@taylorsw04
Copy link
Collaborator

This PR adds a cached size field to all internal nodes and updates it as appropriate. This change is a precursor to the set operations PR (#48) and is required to do such bulk operations in sub-linear time.

As part of this PR, the check valid method was enhanced and made more robust to ensure the cached size is correct (some of the logic is more useful for validating set operations, and was pulled out of that PR).

@taylorsw04 taylorsw04 requested a review from qwertie November 21, 2025 22:34
@taylorsw04
Copy link
Collaborator Author

@qwertie fyi I'm splitting this out from #48 as it is the only change to the core BTree and I assume you'll want to review (I can have my team review the other non-core changes). There aren't additional tests here because all calls to checkValid now check the size caching, and the (wildly) robust fuzz tests in #48 cover it.

@taylorsw04
Copy link
Collaborator Author

@qwertie are you okay if I merge this? Anything you'd like to see changed?

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