# HG changeset patch # User Pierre-Yves David # Date 2024-03-13 10:38:28 # Node ID b4a6a1ff8fce2b240f26388f2701e30f98b52fd1 # Parent 6378d57562af5416af3a4b45267e5d28aa9f6ac3 tags-cache: skip the filternode step if we are not going to use it When warming the hgtagsfnodescache, we don't need the actual result, so we can simply skip the part that "filter" fnode we read from the cache. So provide a quite visible speed up to the top level `hg debugupdatecache` function. ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.debug.debug-update-cache # bin-env-vars.hg.flavor = default # bin-env-vars.hg.py-re2-module = default # benchmark.variants.pre-state = warm before: 19.947581 after: 18.916804 (-5.17%, -1.03) diff --git a/mercurial/tags.py b/mercurial/tags.py --- a/mercurial/tags.py +++ b/mercurial/tags.py @@ -83,7 +83,9 @@ from .utils import stringutil def warm_cache(repo): """ensure the cache is properly filled""" unfi = repo.unfiltered() - fnoderevs(repo.ui, unfi, unfi.changelog.revs()) + tonode = unfi.changelog.node + nodes = [tonode(r) for r in unfi.changelog.revs()] + _getfnodes(repo.ui, repo, nodes) def fnoderevs(ui, repo, revs):