diff options
author | Elijah Newren <newren@gmail.com> | 2021-03-11 00:38:31 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-10 22:18:05 -0800 |
commit | e4fd06e7e2fa9c433597b76245e38e545eec9ec0 (patch) | |
tree | 4192a567bfafc57ed0e20713c051bdd0f1db5449 /t/helper/test-online-cpus.c | |
parent | merge-ort: skip rename detection entirely if possible (diff) | |
download | tgif-e4fd06e7e2fa9c433597b76245e38e545eec9ec0.tar.xz |
diffcore-rename: avoid doing basename comparisons for irrelevant sources
The basename comparison optimization implemented in
find_basename_matches() is very beneficial since it allows a source to
sometimes only be compared with one other file instead of N other files.
When a match is found, both a source and destination can be removed from
the matrix of inexact rename comparisons. In contrast, the irrelevant
source optimization only allows us to remove a source from the matrix of
inexact rename comparisons...but it has the advantage of allowing a
source file to not even be loaded into memory at all and be compared to
0 other files. Generally, not even comparing is a bigger performance
win, so when both optimizations could apply, prefer to use the
irrelevant-source optimization.
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: 5.708 s ± 0.111 s 5.680 s ± 0.096 s
mega-renames: 102.171 s ± 0.440 s 13.812 s ± 0.162 s
just-one-mega: 3.471 s ± 0.015 s 506.0 ms ± 3.9 ms
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-online-cpus.c')
0 files changed, 0 insertions, 0 deletions