Mercurial > public > mercurial-scm > hg
comparison mercurial/setdiscovery.py @ 41280:f4277a35c42c
discovery: compute newly discovered missing in a more efficient way
Calling "descendants" is expensive, instead, we bound the walk inside the know set
of undecided revision.
This help with discovery performance:
# without the revset '%ld' improvement
$ hg perfdiscovery -R pypy-left pypy-right
before: wall 0.675631 comb 0.680000 user 0.670000 sys 0.010000 (median of 15)
after: wall 0.520145 comb 0.530000 user 0.510000 sys 0.020000 (median of 19)
There is another series in flight that greatly improves performances of "%ld"
substitution in `repo.revs` call. If this changeset is applied above it, we
see a similar performance boost.
# with the revset '%ld' improvement
$ hg perfdiscovery -R pypy-left pypy-right
before: wall 0.477848 comb 0.480000 user 0.480000 sys 0.000000 (median of 22)
after: wall 0.404163 comb 0.400000 user 0.400000 sys 0.000000 (median of 24)
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 04 Jan 2019 16:04:48 +0100 |
parents | 2a8782cc2e16 |
children | 76873548b051 |
comparison
equal
deleted
inserted
replaced
41279:c9e1104e6272 | 41280:f4277a35c42c |
---|---|
185 self._common.addbases(commons) | 185 self._common.addbases(commons) |
186 self._common.removeancestorsfrom(self.undecided) | 186 self._common.removeancestorsfrom(self.undecided) |
187 | 187 |
188 def addmissings(self, missings): | 188 def addmissings(self, missings): |
189 """registrer some nodes as missing""" | 189 """registrer some nodes as missing""" |
190 if self.missing: | 190 newmissing = self._repo.revs('%ld::%ld', missings, self.undecided) |
191 new = self._repo.revs('descendants(%ld) - descendants(%ld)', | 191 if newmissing: |
192 missings, self.missing) | 192 self.missing.update(newmissing) |
193 self.missing.update(new) | 193 self.undecided.difference_update(newmissing) |
194 else: | |
195 self.missing.update(self._repo.revs('descendants(%ld)', missings)) | |
196 | |
197 self.undecided.difference_update(self.missing) | |
198 | 194 |
199 def addinfo(self, sample): | 195 def addinfo(self, sample): |
200 """consume an iterable of (rev, known) tuples""" | 196 """consume an iterable of (rev, known) tuples""" |
201 common = set() | 197 common = set() |
202 missing = set() | 198 missing = set() |