Mercurial > hg
view mercurial/templates/map-cmdline.show @ 49580:08fe5c4d4471 stable
tags-fnode-cache: skip building a changectx in getfnode
Building a changectx object is costly, doing it just to retrieve the revision
number is suboptimal. Directly fetching the revision number from the changelog
provide a sizeable speedup to `hg debugupdatecache`.
### data-env-vars.name = mercurial-2018-08-01-zstd-sparse-revlog
# benchmark.name = debug-update-cache
# benchmark.variants.pre-state = warm
before: 0.213229 seconds
after: 0.165577 seconds (-22.35%)
# data-env-vars.name = mercurial-filtered-2019-11-22-zstd-sparse-revlog
before: 1.200383 seconds
after: 1.071618 seconds (-10.73%)
# data-env-vars.name = mozilla-central-2018-08-01-zstd-sparse-revlog
before: 1.465735 seconds
after: 0.923128 seconds (-37.02%)
# data-env-vars.name = mozilla-try-2019-02-18-zstd-sparse-revlog
before: 6.511771 seconds
after: 4.507316 seconds (-30.78%)
# data-env-vars.name = netbeans-2018-08-01-zstd-sparse-revlog
before: 1.023007 seconds
after: 0.645026 seconds (-36.95%)
# data-env-vars.name = pypy-2018-08-01-zstd-sparse-revlog
before: 0.381141 seconds
after: 0.268654 seconds (-29.51%)
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 12 Nov 2022 02:38:53 +0100 |
parents | b45c353ebbc7 |
children |
line wrap: on
line source
# TODO there are a few deficiencies in this file: # * The "namespace" of the labels needs to be worked out. We currently # piggyback on existing values so color works. %include map-cmdline.default [templates] showbookmarks = '{if(active, "*", " ")} {pad(bookmark, longestbookmarklen + 4)}{shortest(node, nodelen)}\n' showwork = '{cset_shortnode}{namespaces % cset_namespace} {cset_shortdesc}' showstack = '{showwork}' cset_shortnode = '{labelcset(shortest(node, nodelen))}' # Treat branch and tags specially so we don't display "default" or "tip" cset_namespace = '{ifeq(namespace, "branches", names_branches, ifeq(namespace, "tags", names_tags, names_others))}' names_branches = '{ifeq(branch, "default", "", " ({label('log.{colorname}', branch)})")}' names_tags = '{if(filter_tags(names), " ({label('log.{colorname}', join(filter_tags(names), ' '))})")}' names_others = '{if(names, " ({label('log.{colorname}', join(names, ' '))})")}' cset_shortdesc = '{label("log.description", desc|firstline)}' [templatealias] filter_tags(names) = filter(names, ifeq(name, 'tip', '', name))