-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wip][performance] Use pread when possible to avoid read amplificatio…
…n caused by buffering - [ ] THIS APPROACH IS DOOMED! The reason being that indexed_gzip, indexed_bzip2, indexed_zstd, and rapidgzip implement fileno members returning the file descriptor of the UNDERLYING FUCKING file, i.e., the compressed file. This INVALIDATES MY ASSUMPTION that os.pread(file.fileno) == file.seek() + file.read()!!! Instead, implement a custom file reader class with a pread member, whose existence we can check for and/or inject such a pread member into the file object returned by Python's open builtin. - [ ] Add pread members to indexed_bzip2 and rapidgzip. - [ ] Add an extra commit before this that adds a buffer size argument like Python's open has, and then use pread for the special case of buffer size == 0. And only set this to 0 from the FuseMount class' open, so that ratarmountcoure MountSource.open usage does not loose the buffering! - [ ] Check at what locations pread is exactly necessary!
- Loading branch information
Showing
2 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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