BatchedFetchStore for shard index caching and range batching#41
Open
wietzesuijker wants to merge 1 commit into
Open
BatchedFetchStore for shard index caching and range batching#41wietzesuijker wants to merge 1 commit into
wietzesuijker wants to merge 1 commit into
Conversation
|
@wietzesuijker is attempting to deploy a commit to the carbonplan Team on Vercel. A member of the Team first needs to authorize it. |
ed7071a to
faeef32
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wraps all fetch stores with
BatchedFetchStoreto cut HTTP requests when rendering sharded Zarr v3 datasets.zarrita.js creates a fresh shard-index cache per
open(array)call, so for a 3-band RGB layer the same shard index is fetched 3× per shard per viewport.BatchedFetchStorecaches suffix-length range reads (always shard-index fetches) in an LRU so bands 2 and 3 are served from memory. It also batches concurrentgetRangecalls within the same event-loop tick: calls are accumulated, sorted by offset, grouped into merged ranges (32 KB gap threshold), fetched as fewer HTTP requests, then sliced back to callers — modelled on geotiff.jsBlockedSource.For a 3-band sharded Zarr v3 (e.g. Sentinel-2 EOPF, 9-tile viewport):
BatchedFetchStoreis adapted from the zarrita.js development branch (MIT, same org) and should be removed from this repo once@zarrita/storageships it.AI (Claude) supported my development of this PR.