]> git.ipfire.org Git - thirdparty/git.git/commitdiff
merge-ort: use relevant_sources to filter possible rename sources
authorElijah Newren <newren@gmail.com>
Thu, 11 Mar 2021 00:38:29 +0000 (00:38 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Mar 2021 06:18:05 +0000 (22:18 -0800)
The past several commits determined conditions when rename sources might
be needed, and filled a relevant_sources strset with those paths.  Pass
these along to diffcore_rename_extended() to use to limit the sources
that we need to detect renames for.

For the testcases mentioned in commit 557ac0350d ("merge-ort: begin
performance work; instrument with trace2_region_* calls", 2020-10-28),
this change improves the performance as follows:

                            Before                  After
    no-renames:       12.596 s ±  0.061 s     6.003 s ±  0.048 s
    mega-renames:    130.465 s ±  0.259 s   114.009 s ±  0.236 s
    just-one-mega:     3.958 s ±  0.010 s     3.489 s ±  0.017 s

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-ort.c

index 5840832cf3ed75325fd3e98c12a76ad4856dcdde..eea14024c657d8370a01f295c36aae7a911f02fd 100644 (file)
@@ -2208,7 +2208,7 @@ static void detect_regular_renames(struct merge_options *opt,
        diff_queued_diff = renames->pairs[side_index];
        trace2_region_enter("diff", "diffcore_rename", opt->repo);
        diffcore_rename_extended(&diff_opts,
-                                NULL,
+                                &renames->relevant_sources[side_index],
                                 &renames->dirs_removed[side_index],
                                 &renames->dir_rename_count[side_index]);
        trace2_region_leave("diff", "diffcore_rename", opt->repo);