Skip to main content

Module index

Module index 

Source
Expand description

Working-tree hash cache (.cadvm/index.json).

Hashing every tracked file on each status is wasteful on large STEP files. This cache remembers, per path, the file’s size + modification time and the content hash computed last time. When a file’s size and mtime are unchanged, its hash is reused instead of re-reading and re-hashing the whole file.

The cache is a transparent optimization: a miss simply re-hashes. It never affects correctness — a stale entry can only occur if a file is rewritten with the exact same size and mtime, which the filesystem’s nanosecond mtime makes effectively impossible in practice.

Structs§

HashCache
A size+mtime keyed cache of working-file content hashes.