Implement FileBufRead for SequentialFileReader#9701
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9701 +/- ##
========================================
Coverage 82.5% 82.5%
========================================
Files 844 844
Lines 316758 317014 +256
========================================
+ Hits 261579 261830 +251
- Misses 55179 55184 +5 🚀 New features to boost your workflow:
|
c065db3 to
9905887
Compare
brooksprumo
reviewed
Jan 16, 2026
brooksprumo
approved these changes
Jan 16, 2026
brooksprumo
left a comment
There was a problem hiding this comment.
Looks good to me. If there are changes for the nits, they can either be handled here or in a follow-up PR.
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.
Problem
Accounts db uses stack based file reader (heaviest used in generate index) that does small sync reads. They could use io-uring reader to save some cpu on syscalls, but SequentialFileReader's API operates on single file and is initialized with a path.
In order to use io-uring reader for generate index and other accounts-db cases we need to support
FileBufReadtrait that hasset_file(&File)function such that reader will perform reads onFilethat is kept open before and after reading.Summary of Changes
FileBufReadtrait, which allows activating read for a given&FileNote: this PR is extracted from #6878 and rebased to current code-base. It does include some of the APIs and optimizations (prefetching / reading multiple files, low-level tuning based on profiles where reading was CPU bound) that might not be necessary in near future. They could be undone to minimize the diff of this PR, but the features still seem relevant for longer-term (e.g. reading list of multiple files known ahead of time, minimizing CPU overheads).