gabriel / muse public
perf patch task/perf-branch-stash #1 / 1
gabriel · 62 days ago · Apr 14, 2026 · Diff

perf: pre-compute branch ancestor set once; stash uses has_object

branch.py: _commit_ancestors was called once per branch inside _passes, rebuilding the full ancestor DAG of 'into' from scratch each time. With N branches, --merged did O(N × commits) reads. Pre-compute the ancestor set once before the filter loop: O(commits) reads total.

stash.py: _verify_manifest_objects called read_object() (loads full bytes) to check existence. Replace with has_object() (path stat only).

Tests (TDD): TestStress::test_merged_filter_ancestor_set_computed_once, TestStashPerf (2 tests: structural + behavioral).

sha256:9dcb396cb3fad0e9d6b656be2d96d029cafc3da1c9740a81184a115e8d4e0524 sha
sha256:96eea3948b3e73d8c5e398979150a3e8541b33d79e42902e12384b040b2d9fa8 snapshot
← Older Oldest on task/perf-branch-stash
All commits
Newer → Latest on task/perf-branch-stash

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:9dcb396cb3fad0e9d6b656be2d96d029cafc3da1c9740a81184a115e8d4e0524 --body "your comment"