Problem
Currently, every archive run re-hashes ALL discovered files to check against the manifest. For large source directories (e.g. ~/Dev with thousands of files), this is O(n) SHA-256 computations on every run, even when nothing has changed.
Proposed fix
Track file modification time (mtime) and size in the manifest entries. On subsequent runs:
- If mtime+size match the manifest entry → skip hashing entirely
- If mtime or size differ → re-hash and check for content changes
- New files → hash as usual
This is the same approach git uses for its index (stat cache).
References
- Git index format: mtime+size as stat cache
- Go
os.FileInfo.ModTime() and os.FileInfo.Size()
Acceptance criteria
Problem
Currently, every archive run re-hashes ALL discovered files to check against the manifest. For large source directories (e.g. ~/Dev with thousands of files), this is O(n) SHA-256 computations on every run, even when nothing has changed.
Proposed fix
Track file modification time (mtime) and size in the manifest entries. On subsequent runs:
This is the same approach git uses for its index (
statcache).References
os.FileInfo.ModTime()andos.FileInfo.Size()Acceptance criteria
mod_timeandsize_bytesfields