[PATCH 06 of 13] perf: prewarm the branchmap in perfbranchmapload

Boris Feld boris.feld at octobus.net
Fri Nov 23 09:09:02 EST 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 9f543638d909768a0db0aa779d37817c4b8878ab
# Parent  e72da9d014ba91ee4f2fe620a9646404a64d7484
# EXP-Topic perf-branchmap
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 9f543638d909
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
@@ -2203,6 +2203,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