# HG changeset patch # User Boris Feld <boris.f...@octobus.net> # Date 1542710780 0 # Tue Nov 20 10:46:20 2018 +0000 # Node ID e5c18b7087cdeac2a1213c3499e9a8215b252af6 # Parent a2a4aabea58bef816eeb53e80ddaf0d438717c66 # EXP-Topic perf-tags # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r e5c18b7087cd perf: add a `clear-revlogs` flag to `perftags`
This flag (on by default) makes it possible to disable the refresh of the changelog and revlog. This is useful to check for the time spent in the core tags logic without the associated side effects. Usually, these side effects are shared with other logics (eg: bookmarks). Example output in my Mercurial repository $ hg perftags ! wall 0.017919 comb 0.020000 user 0.020000 sys 0.000000 (best of 141) $ hg perftags --no-clear-revlogs ! wall 0.012982 comb 0.010000 user 0.010000 sys 0.000000 (best of 207) diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -536,7 +536,10 @@ def perfheads(ui, repo, **opts): timer(d) fm.end() -@command(b'perftags', formatteropts) +@command(b'perftags', formatteropts+ + [ + (b'', b'clear-revlogs', True, 'refresh changelog and manifest'), + ]) def perftags(ui, repo, **opts): import mercurial.changelog import mercurial.manifest @@ -545,9 +548,11 @@ def perftags(ui, repo, **opts): timer, fm = gettimer(ui, opts) svfs = getsvfs(repo) repocleartagscache = repocleartagscachefunc(repo) + clearrevlogs = opts['clear_revlogs'] def s(): - clearchangelog(repo) - clearfilecache(repo.unfiltered(), 'manifest') + if clearrevlogs: + clearchangelog(repo) + clearfilecache(repo.unfiltered(), 'manifest') repocleartagscache() def t(): return len(repo.tags()) _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel