-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Exponential read-ahead cache #140
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
base: main
Are you sure you want to change the base?
Conversation
weiji14
left a comment
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.
Recommend to add a unit test 🙂
| let chunk = b.slice(start..end); | ||
| out_buffers.push(chunk); |
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.
The slice here might return an empty chunk, and the .push would fail with "IOError(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" })". Maybe re-check the logic here?
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.
Can you think of an example of a unit test that would catch this?
|
I added some unit tests in |
Replace simple prefetch buffer with exponential readahead cache for more efficient metadata fetching, and improve Python error handling.
Supersedes and closes #83, closes #89
Change list
ReadaheadMetadataCachegrows fetch sizes (configurable viainitial_sizeandmultiplierparameters)PyAsyncTiffErrorenum, so the existing test that checked forFileNotFoundErrorwould still pass. Better exception handling is tracked in Improved Python error handling #144