@matheusbsbs / matheus-bagliano / commits / 8777616e4d
Fork 0

merge: optimization to skip evaluate_result for single strategy

For a merge with a single strategy, the result of evaluate_result() is effectively not used and therefore is not needed, so avoid altogether. On Windows, this optimization can halve the time required to perform a recursive merge of a single commit with the LLVM repo. Signed-off-by: Andrew Ng <andrew.ng@sony.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Andrew Ng committed May 19, 2020 at 14:05 UTC 8777616e4db2868609bc42a4c66cc69d23532dbc
1 file changed +1 -1
builtin/merge.c
+1 -1
@@ -1629,7 +1629,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
1629 }
1630 merge_was_ok = 1;
1631 }
1632 - cnt = evaluate_result();
1632 + cnt = (use_strategies_nr > 1) ? evaluate_result() : 0;
1633 if (best_cnt <= 0 || cnt <= best_cnt) {
1634 best_strategy = use_strategies[i]->name;
1635 best_cnt = cnt;