comparison mercurial/tags.py @ 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
comparison
equal deleted inserted replaced
51596:6378d57562af 51597:b4a6a1ff8fce
81 81
82 82
83 def warm_cache(repo): 83 def warm_cache(repo):
84 """ensure the cache is properly filled""" 84 """ensure the cache is properly filled"""
85 unfi = repo.unfiltered() 85 unfi = repo.unfiltered()
86 fnoderevs(repo.ui, unfi, unfi.changelog.revs()) 86 tonode = unfi.changelog.node
87 nodes = [tonode(r) for r in unfi.changelog.revs()]
88 _getfnodes(repo.ui, repo, nodes)
87 89
88 90
89 def fnoderevs(ui, repo, revs): 91 def fnoderevs(ui, repo, revs):
90 """return the list of '.hgtags' fnodes used in a set revisions 92 """return the list of '.hgtags' fnodes used in a set revisions
91 93