# HG changeset patch # User Boris Feld # Date 1542916813 -3600 # Node ID 45a0047c0ebcf12ad75001bdc4257a5966347ffc # Parent ba706e3082bd6164b5c4c3b29b518fa33c7c9944 perf: add a perfignore command The command is meant to benchmark operations related to hgignore. Right now the command is benchmarking the loading time of the hgignore rules. diff -r ba706e3082bd -r 45a0047c0ebc contrib/perf.py --- a/contrib/perf.py Mon Nov 26 15:36:06 2018 +0300 +++ b/contrib/perf.py Thu Nov 22 21:00:13 2018 +0100 @@ -975,6 +975,23 @@ timer(d) fm.end() +@command(b'perfignore', formatteropts) +def perfignore(ui, repo, **opts): + """benchmark operation related to computing ignore""" + opts = _byteskwargs(opts) + timer, fm = gettimer(ui, opts) + dirstate = repo.dirstate + + def setupone(): + dirstate.invalidate() + clearfilecache(dirstate, b'_ignore') + + def runone(): + dirstate._ignore + + timer(runone, setup=setupone, title=b"load") + fm.end() + @command(b'perfindex', formatteropts) def perfindex(ui, repo, **opts): import mercurial.revlog diff -r ba706e3082bd -r 45a0047c0ebc tests/test-contrib-perf.t --- a/tests/test-contrib-perf.t Mon Nov 26 15:36:06 2018 +0300 +++ b/tests/test-contrib-perf.t Thu Nov 22 21:00:13 2018 +0100 @@ -86,6 +86,7 @@ perfhelper-pathcopies find statistic about potential parameters for the 'perftracecopies' + perfignore benchmark operation related to computing ignore perfindex (no help text available) perflinelogedits (no help text available) @@ -166,6 +167,7 @@ fncache already up to date #endif $ hg perfheads + $ hg perfignore $ hg perfindex $ hg perflinelogedits -n 1 $ hg perfloadmarkers