Skip to content

open_remote: keep fetched blocks (fsspec blockcache) on windowed reads - #57

Merged
SmithB merged 1 commit into
mainfrom
blockcache_reads
Sep 25, 2026
Merged

SmithB merged 1 commit into
mainfrom
blockcache_reads

Conversation

@SmithB

@SmithB SmithB commented Sep 25, 2026

Copy link
Copy Markdown
Owner

A windowed read (one with a block_size) now opens with cache_type='blockcache' instead of fsspec's default one-block 'readahead'. Reading a range out of a chunked, compressed HDF5 file comes back to blocks it has already fetched, and with one cached block each return was another S3 request: measured on MAAP-ADE 2026-09-25, an ATL11 range read of ~1,400 points fetched ~30 MB (7 MB with the block cache), and whole prelim tiles read 1.71 -> 0.26 GB (IS), 4.37 -> 0.58 GB (GL), 9.90 -> 1.54 GB (AA), 1.9-2.8x faster, with identical data.

Memory is only the blocks a read touches, up to DEFAULT_REMOTE_CACHE_BYTES (1 GiB) per open file. Reads without a block_size keep the filesystem's defaults. A filesystem whose open() takes no cache_type still gets its block_size. Also corrects the docstring: s3fs's default block is 50 MiB.

tests/test_remote_cache.py uses a real fsspec filesystem over local bytes that counts fetched bytes; it fails without the change. (Two tests in test_cloud* about a missing remote index fail on main already, unrelated.)

A windowed read (one with a block_size) now opens with cache_type='blockcache'
instead of fsspec's default one-block 'readahead'.  Reading a range out of a
chunked, compressed HDF5 file comes back to blocks it has already fetched, and
with one cached block each return was another S3 request: measured on MAAP-ADE
2026-09-25, an ATL11 range read of ~1,400 points fetched ~30 MB (7 MB with the
block cache), and whole prelim tiles read 1.71 -> 0.26 GB (IS), 4.37 -> 0.58 GB
(GL), 9.90 -> 1.54 GB (AA), 1.9-2.8x faster, with identical data.

Memory is only the blocks a read touches, up to DEFAULT_REMOTE_CACHE_BYTES
(1 GiB) per open file.  Reads without a block_size keep the filesystem's
defaults.  A filesystem whose open() takes no cache_type still gets its
block_size.  Also corrects the docstring: s3fs's default block is 50 MiB.

tests/test_remote_cache.py uses a real fsspec filesystem over local bytes that
counts fetched bytes; it fails without the change.  (Two tests in test_cloud*
about a missing remote index fail on main already, unrelated.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SmithB
SmithB merged commit 09ae668 into main Sep 25, 2026
0 of 2 checks passed
@SmithB
SmithB deleted the blockcache_reads branch September 25, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant