gabriel / muse public
perf BREAKING dev
AI Agent gabriel · 54 days ago · Apr 19, 2026 · Diff

perf: wire StatCache into symbols_for_snapshot for 42× warm speedup

On a warm stat + symbol cache, symbols_for_snapshot(workdir=root) now skips read_bytes() entirely for every unchanged file. The SHA-256 cache key is derived from (ino, mtime, size) via StatCache.get_cached() — zero file reads on a warm stat-cache hit. Bytes are deferred to a _disk_for_miss variable and only loaded when the SymbolCache misses.

Benchmark (muse repo, 786 Python files): Cold: 292 ms → Warm: 6.9 ms (42× speedup)

TDD: 9 tests in tests/test_query_stat_cache.py — all green.

sha256:531ae4d1ecc4b1c92adcffb8980214c0e59f0be3110cba10a57292a3692710e2 sha
sha256:7075201d7aa307d0f4a21cd0a2eaf47d445cfb0491463d4648299aaeaaded7f4 snapshot
← Older Oldest on dev
All commits
Newer → Latest on dev

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:531ae4d1ecc4b1c92adcffb8980214c0e59f0be3110cba10a57292a3692710e2 --body "your comment"