Repository navigation
perf: directory read-ahead (bulk ReadMany) - #23
Merged
Merged
Conversation
Adds a bulk-read path so a sequential reader pays ~one round-trip per directory instead of one per file: - protocol: ReadManyRequest/ReadManyResponse (several files' whole contents, or a not-found marker each, in one frame). - server: send_read_many reads the requested files, bounded to one frame. - client: on a read miss, RemoteRoot synchronously bulk-fetches the target plus its uncached small siblings (one ReadMany) and caches them all; a background prefetcher fills the tail of large directories. read_many() is public for callers/tests. Verified end-to-end on Direction A (Windows->WSL, fast transport): 3000 files read cold in 574 ms (warm 366 ms) vs 2856 ms over \\wsl.localhost. The same path is correct for Direction B, but that direction is bottlenecked by the WSL->Windows localhost-forwarding relay latency (seconds/round-trip) — the Hyper-V socket transport is the fix (see bench/RESULTS.md). Tests: ReadManyBulkFetch and PrefetchWarmsSiblings. 98/98 Windows, 97/97 Linux, zero warnings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Bulk ReadMany + directory read-ahead: one round-trip per directory instead of per file. Verified on Direction A (3000 files cold 574 ms). Direction B remains transport-bound (hv-sockets next). See bench/RESULTS.md.