Skip to main content

Module graph_cache

Module graph_cache 

Source
Expand description

Resident graph-index cache (Phase 5 of the efficiency epic).

try_load_graph_index used to deserialize the on-disk ProjectIndex (read + zstd-decompress + serde parse) on every query that touches the graph (symbol lookups, related hints, impact). This keeps the deserialized index resident in RAM keyed by project root, invalidated by the on-disk index file’s mtime so a background rebuild is picked up immediately (no TTL wait). Callers that need an owned value get a cheap in-memory clone instead of a disk round-trip.

Functions§

get_cached
Returns the resident ProjectIndex for project_root, loading from disk only when absent or when the on-disk index file changed. None when no non-empty index exists on disk.
invalidate
Drops the cached graph index for a root (or all roots when None).