Combined: hashtable + rax memory tracking with vset integration#9
Draft
liorsve wants to merge 11 commits into
Draft
Combined: hashtable + rax memory tracking with vset integration#9liorsve wants to merge 11 commits into
liorsve wants to merge 11 commits into
Conversation
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
7b0d930 to
7d89748
Compare
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
7d89748 to
b29de3a
Compare
This was referenced Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Combined branch providing O(1) logical size reporting for hash objects via
hashTypeLogicalSize(). Integrates hashtable entry tracking with rax/stream/vset tracking into a single branch.How this branch was built
This branch is based on
hashtable-logical-size-tracking(PR #5) with all commits fromrax-data-tracking-caller(PR #6) cherry-picked on top. That said, the other two POC branches for rax tracking can be used just the same. Then the vset integration was added as a new commit to wire everything together. So the new integration code is only commit 7d89748What this branch adds on top
hashTypeLogicalSize()— O(1) total hash memoryNew function in
object.cthat combines all tracked counters into a single O(1) read:For hashtable encoding, this replaces the O(n) sampled walk in
objectComputeSizewith an O(1) read.vsetLogicalSize()— O(1) vset container sizeNew function in
vset.c. Returns the logical size of the vset's own container memory:sizeof(pVector) + pvLen(pv) * sizeof(void *)sizeof(vsetRaxState) + raxLogicalSize(r) + tracked_data_bytesvsetComputeLogicalSize()— O(n) walk for test verificationNew function in
vset.c. Walks all vset structures independently of tracked counters. Used only in tests to verify tracked values are correct.Updated test assertions
All HASH tracking tests now verify both data tracking AND total logical size (including vset) at every assertion point via
ASSERT_HASH_LOGICAL_SIZE(o, ht), which checks:ASSERT_TRACKED_DATA_CORRECT—hashtableTrackedDataBytesvs independent entry walkASSERT_TRACKED_OVERHEAD_CORRECT—hashtableMemUsage + vsetLogicalSizevs independent overhead walk usingvsetComputeLogicalSize3 new vset-specific tests
vsetLogicalSize == 0.