Skip to content

Add CacheIO read-cache layer for disk IO #2420

Description

@LHT129

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureBrand-new functionality or capabilities 引入全新的功能、新特性或新能力version/1.0

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions