gabriel / muse public
perf BREAKING task/perf-stat-cache-and-manifest-cache #1 / 1
gabriel · 62 days ago · Apr 14, 2026 · Diff

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.

sha256:4f85f1ba8ffc81876a35569e4f63559e57fb7c0d3110d36af3752ebc3ed8ee2b sha
sha256:8e8011cba84ba66c1689fe579e83e664f294e9eb48e360931135674f0638295d snapshot
← Older Oldest on task/perf-stat-cache-and-manifest-cache
All commits
Newer → Latest on task/perf-stat-cache-and-manifest-cache

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:4f85f1ba8ffc81876a35569e4f63559e57fb7c0d3110d36af3752ebc3ed8ee2b --body "your comment"