changeset 51597:b4a6a1ff8fce

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)
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 13 Mar 2024 11:38:28 +0100
parents 6378d57562af
children 2664cacd2457
files mercurial/tags.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/tags.py	Wed Mar 13 11:34:21 2024 +0100
+++ b/mercurial/tags.py	Wed Mar 13 11:38:28 2024 +0100
@@ -83,7 +83,9 @@
 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):