Mercurial > public > mercurial-scm > hg
comparison mercurial/bundlerepo.py @ 51417:ac1c75188440
phases: invalidate the phases set less often on retract boundary
We already have the information to update the phase set, so we do so directly
instead of invalidating the cache.
This show a sizeable speedup in our `perf::unbundle` benchmark on the
many-draft mozilla-try repository.
### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog
# benchmark.name = hg.perf.perf-unbundle
# bin-env-vars.hg.flavor = no-rust
# bin-env-vars.hg.py-re2-module = default
# benchmark.variants.issue6528 = disabled
# benchmark.variants.revs = last-10
before: 2.055259 seconds
after: 1.887064 seconds (-8.18%)
# benchmark.variants.revs = last-100
before: 2.409239 seconds
after: 2.222429 seconds (-7.75%)
# benchmark.variants.revs = last-1000
before: 3.945648 seconds
after: 3.762480 seconds (-4.64%)
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 21 Feb 2024 13:05:29 +0100 |
parents | 04111ef08fb0 |
children | 493034cc3265 |
comparison
equal
deleted
inserted
replaced
51416:e57d4b868a3e | 51417:ac1c75188440 |
---|---|
267 raise NotImplementedError | 267 raise NotImplementedError |
268 | 268 |
269 def _write(self, fp): | 269 def _write(self, fp): |
270 raise NotImplementedError | 270 raise NotImplementedError |
271 | 271 |
272 def _updateroots(self, repo, phase, newroots, tr): | 272 def _updateroots(self, repo, phase, newroots, tr, invalidate=True): |
273 self._phaseroots[phase] = newroots | 273 self._phaseroots[phase] = newroots |
274 self.invalidate() | 274 if invalidate: |
275 self.invalidate() | |
275 self.dirty = True | 276 self.dirty = True |
276 | 277 |
277 | 278 |
278 def _getfilestarts(cgunpacker): | 279 def _getfilestarts(cgunpacker): |
279 filespos = {} | 280 filespos = {} |