Background
VSAG IO module provides multiple disk IO implementations (BufferIO, MMapIO, AsyncIO) for vector index persistence and loading. In vector search scenarios, graph traversal (e.g. HNSW/HGraph) generates many random small reads with strong locality — hot nodes are accessed repeatedly. Currently all reads go directly to disk (pread/mmap page fault) without leveraging access locality, leaving optimization opportunity.
Proposed Solution
Add CacheIO as a read-cache layer that wraps any disk-backed IO:
- Page-based cache management (default 128KB, configurable)
- Configurable total cache size (default 256MB)
- Pluggable eviction strategy (LRU as first implementation)
- Read/DirectRead/MultiRead go through cache; Write passes through to InnerIO
- CRTP architecture, zero virtual function overhead
Related PR
#2419
Background
VSAG IO module provides multiple disk IO implementations (BufferIO, MMapIO, AsyncIO) for vector index persistence and loading. In vector search scenarios, graph traversal (e.g. HNSW/HGraph) generates many random small reads with strong locality — hot nodes are accessed repeatedly. Currently all reads go directly to disk (pread/mmap page fault) without leveraging access locality, leaving optimization opportunity.
Proposed Solution
Add CacheIO as a read-cache layer that wraps any disk-backed IO:
Related PR
#2419