Skip to content

perf: read cache + real-world cross-boundary benchmark - #21

Merged
zcsizmadia merged 1 commit into
mainfrom
perf-read-cache
Aug 28, 2026
Merged

zcsizmadia merged 1 commit into
mainfrom
perf-read-cache

Conversation

@zcsizmadia

Copy link
Copy Markdown
Collaborator

Client-side read cache (repeat reads served from RAM); mount --listen; and a real-world benchmark. Direction A: wsldrive 2.7x/5.3x faster than \wsl.localhost. See bench/RESULTS.md.

Performance
- RemoteRoot gains an in-RAM read cache: small files (<=8 MiB) are cached whole
  on first read and served locally on repeat reads, keyed by path and validated
  against the mirror's (mtime, size). LRU-evicted to 256 MiB; dropped on
  invalidation and on local writes/truncate/rename. Removes a round-trip per
  repeat read. Stats gain read_cache_hits/misses/bytes.
- Adds `mount --listen` so the client can accept the agent dialing in (used for
  Direction B, where a Windows agent reaches a WSL client via localhost
  forwarding without opening the firewall).

Benchmark (scripts/bench-real.ps1, bench/real_world.md, bench/RESULTS.md)
- Measures both directions vs the OS cross-boundary path and the native floor.
- Direction A (Windows -> WSL ext4), 3000 files: \\wsl.localhost 104 ms walk /
  2856 ms read  vs  wsldrive 39 ms / 538 ms  => 2.7x / 5.3x faster.
- Direction B (WSL -> Windows NTFS): /mnt/c 119 ms walk / 5853 ms read vs native
  10 / 118 ms. wsldrive serves metadata from RAM; cold bulk reads are
  latency-bound (read-ahead/pipelining is the documented next step).

Tests: read-cache agent test (miss/hit/slice/evict-on-write). 96/96 Windows,
95/95 Linux, zero warnings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@zcsizmadia
zcsizmadia merged commit f39a679 into main Aug 28, 2026
3 checks passed
@zcsizmadia
zcsizmadia deleted the perf-read-cache branch August 28, 2026 14:56
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