You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
commit-reach: early exit paint_down_to_common for single merge-base
When find_all is false and generation numbers are available, the
priority queue pops in non-increasing generation order. The first
doubly-painted commit is a valid best merge-base; no later commit
can dominate it. Skip the expensive STALE drain in this case.
The early exit is guarded by three conditions: find_all must be
false, the commit-graph must provide generation numbers, and the
merge-base commit itself must have a finite generation (not
GENERATION_NUMBER_INFINITY from being outside the commit-graph).
Add find_all parameter to repo_get_merge_bases_many_dirty() and
thread it through to paint_down_to_common(). git merge-base
(without --all) passes show_all=0, triggering the early exit.
On a 2.2M-commit merge-heavy monorepo with commit-graph:
HEAD vs ~500: 5,229ms -> 24ms
HEAD vs ~1000: 4,214ms -> 39ms
HEAD vs ~5000: 3,799ms -> 46ms
HEAD vs ~10000: 3,827ms -> 61ms
Signed-off-by: Kristofer Karlsson <krka@spotify.com>
0 commit comments