gabriel / muse public
perf BREAKING migrate perf/migrate-batch #1 / 1
gabriel · 68 days ago · Apr 9, 2026 · Diff

perf(migrate): 14x speedup via batched git processes

Before: O(N) subprocess calls — one git diff-tree + one git show per commit. After: O(1) subprocess calls for the entire branch:

- _batch_commit_log: single git log call reads all SHA + metadata at once using ASCII record/field separators (\x1e/\x1f) for safe multi-line parsing. Merge detection uses the %P parent field — no extra subprocess needed.

- _batch_diff_tree: single git diff-tree --stdin call streams all per-file deltas for the entire branch through one long-running process.

- _CatFile: existing git cat-file --batch process unchanged.

Result on cgcardona/muse (267 commits, 264 merge commits skipped): 26.0s → 9.6s → 1.79s (14.5x overall vs original)

sha256:841573ca87d89c75dce940ebe48d776cd296612080535171dfc655a857ee5858 sha
sha256:9819243465ecf912544c6d74018ca75a70f497e291243ada87826d98b2211c87 snapshot
← Older Oldest on perf/migrate-batch
All commits
Newer → Latest on perf/migrate-batch

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:841573ca87d89c75dce940ebe48d776cd296612080535171dfc655a857ee5858 --body "your comment"