gabriel / muse public
perf patch dev
gabriel · 166 days ago · Apr 14, 2026 · Diff

perf: blame deque + skip unchanged; commit skip unmodified object writes

- blame._walk_ancestry: replace list.pop(0)/insert(0) with deque.popleft()/appendleft() — O(1) vs O(n) per step - blame.blame_file: skip _read_file_at_commit when file object_id is unchanged between commits; only run SequenceMatcher at actual change boundaries - commit.run: skip write_object_from_path for files whose object_id matches the parent manifest — objects already in store, saves N stat calls per commit where N is unchanged file count

Tests: test_walk_ancestry_uses_deque (structural), test_blame_skips_read_for_unchanged_commits (behavioral, ≤4 reads for 10-commit chain with 1 change)

Full suite: 15890 passed

sha256:517bb0b235019f0aefd5da41e683440db35b511b89180331caea65de95f07b18 sha
+3 ~3 symbols
sha256:d9ab3fa4f614c7a3b2021f59fa1a3045b323364d51812335e9b6935072ccdf79 snapshot
+3
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 6 symbols
~ muse/cli/commands/commit.py .py 1 symbol modified
~ run
~ muse/core/blame.py .py 1 symbol added, 2 symbols modified
+ deque import import deque L37–37
~ tests/test_core_blame.py .py 2 symbols added
+ test_blame_skips_read_for_unchanged_commits function function test_blame_skips_read_for_unchanged_commits L236–282
+ test_walk_ancestry_uses_deque function function test_walk_ancestry_uses_deque L221–233
← 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:517bb0b235019f0aefd5da41e683440db35b511b89180331caea65de95f07b18 --body "your comment"