-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disk bucket allocated bit can be not in header #30834
Conversation
64be54c
to
e48e2fc
Compare
bucket_map/src/bucket_storage.rs
Outdated
InHeader, | ||
} | ||
|
||
const FLAG_LOCATION: IsAllocatedFlagLocation = IsAllocatedFlagLocation::InHeader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I see FLAG_LOCATION
by itself in the code, I first think "which flag?". Right now I have the context in my head, so the lookup is fast. And this constant is in the same file, so it'll fast later too. My preferences tend to be more verbose, maybe something along these lines is pleasing to you too?
const FLAG_LOCATION: IsAllocatedFlagLocation = IsAllocatedFlagLocation::InHeader; | |
const IS_ALLOCATED_FLAG_LOCATION: IsAllocatedFlagLocation = IsAllocatedFlagLocation::InHeader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Codecov Report
@@ Coverage Diff @@
## master #30834 +/- ##
=======================================
Coverage 81.4% 81.4%
=======================================
Files 723 723
Lines 203533 203538 +5
=======================================
+ Hits 165845 165872 +27
+ Misses 37688 37666 -22 |
Problem
See #30711
If we store the single bit for 'allocated' status somewhere other than the header of each element, we save 8 bytes per element. Also remember the disk index is possibly 2x over-allocated.
Storage options include:
ref_count
's high bitsSummary of Changes
Placeholders for removing the allocated bit from the header.
Fixes #