[PATCH 1 of 8 V2] perf: prewarm the branchmap in perfbranchmapload

Boris Feld boris.feld at octobus.net
Mon Nov 26 18:44:32 UTC 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1542935471 -3600
#      Fri Nov 23 02:11:11 2018 +0100
# Node ID 578646b1e2b685f8d499e38ee210d3ec5847a550
# Parent  5bcf264bb1a0b1f57f01b4d20f28d9db9a74f47b
# EXP-Topic perf-branchmap
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 578646b1e2b6
perf: prewarm the branchmap in perfbranchmapload

It is not very interesting to have the command randomly failing because the
branchmap for the tested filter happens to be cold. So we make sure to have a
valid up to date branchmap before going further.

The data might still be missing from disk if a subset was equivalent. See next
changeset for details and fix.

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -2251,6 +2251,9 @@ def perfbranchmapload(ui, repo, filter=b
         repo = repoview.repoview(repo, filter)
     else:
         repo = repo.unfiltered()
+
+    repo.branchmap() # make sure we have a relevant, up to date branchmap
+
     # try once without timer, the filter may not be cached
     if branchmap.read(repo) is None:
         raise error.Abort(b'No branchmap cached for %s repo'


More information about the Mercurial-devel mailing list