diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2018-05-01 12:47:21 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-22 12:36:34 +0900 |
commit | 04bc8d1ecc30bae9589f3d77a0a89f3dca28a024 (patch) | |
tree | 2928bb43e41c464afabb8d1d56ccc82595598e7d /contrib/hg-to-git/hg-to-git.py | |
parent | commit: add short-circuit to paint_down_to_common() (diff) | |
download | tgif-04bc8d1ecc30bae9589f3d77a0a89f3dca28a024.tar.xz |
commit: use generation number in remove_redundant()
The static remove_redundant() method is used to filter a list
of commits by removing those that are reachable from another
commit in the list. This is used to remove all possible merge-
bases except a maximal, mutually independent set.
To determine these commits are independent, we use a number of
paint_down_to_common() walks and use the PARENT1, PARENT2 flags
to determine reachability. Since we only care about reachability
and not the full set of merge-bases between 'one' and 'twos', we
can use the 'min_generation' parameter to short-circuit the walk.
When no commit-graph exists, there is no change in behavior.
For a copy of the Linux repository, we measured the following
performance improvements:
git merge-base v3.3 v4.5
Before: 234 ms
After: 208 ms
Rel %: -11%
git merge-base v4.3 v4.5
Before: 102 ms
After: 83 ms
Rel %: -19%
The experiments above were chosen to demonstrate that we are
improving the filtering of the merge-base set. In the first
example, more time is spent walking the history to find the
set of merge bases before the remove_redundant() call. The
starting commits are closer together in the second example,
therefore more time is spent in remove_redundant(). The relative
change in performance differs as expected.
Reported-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/hg-to-git/hg-to-git.py')
0 files changed, 0 insertions, 0 deletions