Repository navigation
Reuse two authenticated chunks during byte-stream seeks - #116
Merged
Merged
Conversation
Keep a fixed two-slot cache in ByteReader to avoid repeatedly fetching whole storage chunks when sparse reads alternate between nearby offsets. Evict the older slot before a miss and install new bytes only after authentication, so failed or cancelled reads preserve the recent authenticated chunk. Document the per-reader cache bound increase from 2 MiB to 4 MiB and cover alternating reads, larger streams, eviction, failures, cancellation, and the original view lifetime. Co-authored-by: Codex <noreply@openai.com>
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.
Repeated seeks during this repository's first Git push fetched each incoming-pack chunk 112 times. Cache the two most recently used authenticated chunks in
ByteReader, evicting the older chunk before a cache miss awaits storage. Sparse reads, the durable format and publication protocol remain unchanged.On the same 6,282-object history through local stock Spin/MinIO, backend traffic fell from 360,831,805 to 37,717,245 bytes (89.6%). Requests fell from 18,494 to 18,272; time changed only slightly, 16.58 to 16.12 seconds. Incremental push/fetch counters are unchanged, and cold clones pass strict fsck. The per-reader cache bound increases from 2 to 4 MiB; caller-held byte slices can retain evicted chunks.
Validation: full
make check, strict native/WASIp2 checks, independent Rust correctness/simplification review, and tests for eviction, failed/cancelled reads, counters, authentication, slice ownership and expired views. The core runtime change is seven net lines. Closes #113.