-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[gridstore] use seq mmap in iter #6750
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
Conversation
let raw = self.read_from_pages(page_id, block_offset, length); | ||
let raw = self.read_from_pages::<true>(page_id, block_offset, length); |
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.
This is the main change (which could've been done without the refactor, but it was a quick change 😸)
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.
Yes! I also put it here.
📝 Walkthrough""" WalkthroughThis change refactors the reading logic in the Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (14)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Also refactor to use const generics
c713ef6
to
33d241f
Compare
/// | ||
pub fn read_value( | ||
/// If the `block_offset` starts after the page ends. | ||
pub fn read_value<const READ_SEQUENTIAL: bool>( |
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.
Any reason for making this boolean generic? I don't like it that much I must admit.
My assumption is that the compiler will produce exactly the same code when we pass a boolean as argument, because it by itself it constant and we have optimizations enabled.
We can probably check it with Godbolt.
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.
Yes, it is unnecessary:
https://rust.godbolt.org/z/heEPzY36n
Putting it in a regular parameter produces exactly the same ASM.
I therefore vote to put it back into parameters.
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.
In our daily we agreed to keep it as is. Changing it is not significant enough. And the current approach actually guarantees that we must provide a constant (so the compiler can optimize it away).
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.
Today I learned about this tool, thanks!
Also refactor to use const generics
Most changes are related to a refactor to use const generics, which removes a bit of code duplication by drilling down a const generic.
Main change is to use the seq mmap in the
Gridstore::iter
function. Looks like we missed this when introducing the seq mmap