Skip to content
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

Use pread #100

Open
mxmlnkn opened this issue Nov 22, 2022 · 1 comment
Open

Use pread #100

mxmlnkn opened this issue Nov 22, 2022 · 1 comment
Labels
performance Something is slower than it could be

Comments

@mxmlnkn
Copy link
Owner

mxmlnkn commented Nov 22, 2022

Currently, StenciledFile and other locations use locks to avoid race conditions between seek and read calls. I'm not sure why I never though ot pread before but it might improve performance for multi-threaded access and even if not, it should simplify the code by removing the lock.

@mxmlnkn mxmlnkn added the performance Something is slower than it could be label Nov 22, 2022
@mxmlnkn
Copy link
Owner Author

mxmlnkn commented Nov 23, 2022

One reason why os.pread is not always possible is the recursion. In those cases the reading has to be done on pure Python file-like objects for which pread cannot be used. But, it should still be possible to implement as a fast-path for real files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Something is slower than it could be
Projects
None yet
Development

No branches or pull requests

1 participant