perf: stat cache for code add; manifest cache for log
- code_stage.py: replace hash_file() with StatCache.get_object_hash() so repeat 'muse code add' on unchanged files hits the inode+mtime+size cache instead of rehashing from disk. Cache saved atomically after each add run.
- log.py: introduce _ManifestCache (dict[commit_id, manifest]) shared across _commit_touches_path, _file_diff, and _commit_to_json within a single run. Previously pathspec filtering + JSON stat mode read the same snapshot 4× per commit (current+parent in each function); now each commit_id is fetched at most once.
Tests (TDD): - TestStatCacheIX (4 tests): structural check, cache-hit on unchanged file, cache file written, cache miss on modified file. - TestManifestCache (3 tests): structural check, each commit_id read ≤1×, pathspec filter correctness with cache active.
0 comments
muse hub commit comment sha256:4f85f1ba8ffc81876a35569e4f63559e57fb7c0d3110d36af3752ebc3ed8ee2b --body "your comment"
No comments yet. Be the first to start the discussion.