Mercurial > public > mercurial-scm > hg
comparison mercurial/changegroup.py @ 41719:5f9d057ba28c
changegroup: don't try to prune manifest nodes if not ellipses
In non-ellipses case, the number of manifest nodes can be very big, and finding
whether one of them can be pruned or not is very costly. For each node, we try
to find the rev and the linkrev, which is expensive.
Sending bit more manifest nodes seems better and much faster here. On our
internal repository, this saves around 5 seconds on `hg tracked --addinclude
<some_path>` on a narrow repo with ellipses disabled.
Differential Revision: https://phab.mercurial-scm.org/D5782
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Thu, 31 Jan 2019 20:11:16 +0300 |
parents | 0531dff73d0b |
children | 1c1c4ef8b72e |
comparison
equal
deleted
inserted
replaced
41718:a87ca1d7e61d | 41719:5f9d057ba28c |
---|---|
1071 # No nodes to send because this directory is out of | 1071 # No nodes to send because this directory is out of |
1072 # the client's view of the repository (probably | 1072 # the client's view of the repository (probably |
1073 # because of narrow clones). Do this even for the root | 1073 # because of narrow clones). Do this even for the root |
1074 # directory (tree=='') | 1074 # directory (tree=='') |
1075 prunednodes = [] | 1075 prunednodes = [] |
1076 elif not self._ellipses: | |
1077 # In non-ellipses case and large repositories, it is better to | |
1078 # prevent calling of store.rev and store.linkrev on a lot of | |
1079 # nodes as compared to sending some extra data | |
1080 prunednodes = nodes.copy() | |
1076 else: | 1081 else: |
1077 # Avoid sending any manifest nodes we can prove the | 1082 # Avoid sending any manifest nodes we can prove the |
1078 # client already has by checking linkrevs. See the | 1083 # client already has by checking linkrevs. See the |
1079 # related comment in generatefiles(). | 1084 # related comment in generatefiles(). |
1080 prunednodes = self._prunemanifests(store, nodes, commonrevs) | 1085 prunednodes = self._prunemanifests(store, nodes, commonrevs) |