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

Don't invalidate cache when opening files 'rb', speed up small read 2x #321

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

0.0.52 (2020-11-29)
+++++++++++++++++++
* Don't invalidate cache when opening files with mode rb, speed up small reads 2x.

0.0.51 (2020-10-15)
+++++++++++++++++++
* Add more logging for zero byte reads to investigate root cause.
Expand Down
3 changes: 2 additions & 1 deletion azure/datalake/store/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,8 @@ def __init__(self, azure, path, mode='rb', blocksize=2 ** 25,
# always invalidate the cache when checking for existence of a file
# that may be created or written to (for the first time).
try:
file_data = self.azure.info(path, invalidate_cache=True, expected_error_code=404)
invalidate = mode != 'rb'
file_data = self.azure.info(path, invalidate_cache=invalidate, expected_error_code=404)
exists = True
except FileNotFoundError:
exists = False
Expand Down