ref:main
perf: optimize Myers diff, Diff3 merge, path-filtered log TREESAME, and graph builder #57
merged
cole.christensen@gmail.com wants to merge
perf/algorithmic-optimizations
into main
No CI
Summary
Pure algorithmic performance optimizations closing the gap between EGOS and native Git CLI across diffing, 3-way merging, path-filtered log traversal, and commit-graph indexing:
-
ExGitObjectstore.Diff.Myers(Myers Diffing):- Upfront (N)$ prefix/suffix line stripping: removes common line blocks before line interning and before building the coordinate matrix.
- Fast paths for identical text inputs ((N)$ pass-through).
- Drops large file diffing runtime by >1,400x on realistic source files (4ms vs 5.9s).
-
ExGitObjectstore.Merge.Diff3(Three-Way File Merge):- Same-file fast paths: immediate resolution for
base == ours,base == theirs, andours == theirswithout running Myers diffs. - (N)$ match-map building when
base == side. - Passes line-interned strings through
Myers.diffwith prefix/suffix trimming, dropping 30k-line file merge from 13.2s to 29ms (>450x speedup).
- Same-file fast paths: immediate resolution for
-
ExGitObjectstore.Walk.log/log_page(History Simplification / TREESAME):- Added path-filtered commit log traversal with Git-style
TREESAMEhistory simplification. - Commits that did not touch
pathare skipped in (1)$ tree entry comparisons. - Merge commits that cleanly inherited
pathfrom a parent prune traversal to follow only that parent branch.
- Added path-filtered commit log traversal with Git-style
-
ExGitObjectstore.Graph.Builder(Commit-Graph Builder):- Single-pass memoized DFS for topological generation numbers and corrected commit dates (replacing Kahn’s algorithm map-bouncing and intermediate children indexing).
- Zero-regex committer timestamp parsing via binary space splitting.
Created Sep 01, 2026 at 14:57 UTC
| Merged Sep 01, 2026 at 16:28 UTC
by
cole.christensen@gmail.com