This is the one command namespace where they should not be any ambiguity about
command that should be in it. The perf extensions is only adding performance
related command.
so this is a good ground to start putting dash folding to the tests.
pulkit | |
Alphare |
hg-reviewers |
This is the one command namespace where they should not be any ambiguity about
command that should be in it. The perf extensions is only adding performance
related command.
so this is a good ground to start putting dash folding to the tests.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
โ refresh by Heptapod after a successful CI run (๐ ๐)
contrib/perf.py | ||
---|---|---|
747 | I took a time machine and answer that question last month ;-) https://www.mercurial-scm.org/pipermail/mercurial-devel/2020-December/144168.html |
contrib/perf.py | ||
---|---|---|
747 | I don't want to endlessly bikeshed this, but the double dash really bothers me for some reason (maybe because it looks like a typo). If we really need a marker for a namespace, maybe ":" would work? But I don't like that too much either, as I can't think of anything that uses that style. Big picture, why do we need to be able to tell namespace parts from command parts? My assumption was that namespaces would simply group commands in a related area (if a command list was sorted), or for a theoretical hg help $namespace. But presumably if we're defining namespaces, the code for that version of hg will know what namespaces are defined, and it's a simple prefix check without spilling implementation details into the UI. |
I'm fine with this as-is, but I am sympathetic to the concern that the -- looks like a mistake. If we want to change it we can, since we've got a full release cycle ahead of us before this is binding.
contrib/perf.py | ||
---|---|---|
747 |
Now is precisely the good time to bikeshed this, (and as Augie pointed, we now have 3.5 month to change whatever pick we get).
The more I have been looking at it, the more I agree. It look as if a space was forgotten before a --option. However we need something better.
Hum why not, we could give it a try (admin:strip). Maybe . (admin.strip).
To make sure the user understand they are stepping in an entire different realm with different rules. In the standard namespace (no prefix) we garantee (or aims at) the lack of footgun and excellent backward compatibility. The debug namespace should not be somewhere any normal user ever have to go (at least without a responsible staff member) The admin namespace will have its own rules and its own "be careful, this is not a "normal" situation to be there. So we want something more distincting than just a simple - that we could have for "command group" or readability like phab-send, phab-read, etc. |
Big picture, why do we need to be able to tell namespace parts from command parts?
To make sure the user understand they are stepping in an entire different realm with different rules.
In the standard namespace (no prefix) we garantee (or aims at) the lack of footgun and excellent backward compatibility.
The debug namespace should not be somewhere any normal user ever have to go (at least without a responsible staff member)
The admin namespace will have its own rules and its own "be careful, this is not a "normal" situation to be there.
So we want something more distincting than just a simple - that we could have for "command group" or readability like phab-send, phab-read, etc.
So it sounds like more of a convention for these behavior properties than say, commands in the admin group requiring --yes-i-know-this-may-eat-my-data. We'll have to have to figure out how to convey that somehow. I see admin, for example, and think "I'm in charge of making this work for my group, and it sounds like it does what I want, so it's for me and just some extra characters to type". I don't have any suggestions on how to highlight these behaviors ATM.
but the double dash really bothers me for some reason (maybe because it looks like a typo).
The more I have been looking at it, the more I agree. It look as if a space was forgotten before a --option. However we need something better.
maybe ":" would work? But I don't like that too much either, as I can't think of anything that uses that style.
Hum why not, we could give it a try (admin:strip). Maybe . (admin.strip).
If simple convention is driving this, I'm not sure that a one character change from - to : or . stands out in a meaningful way. (IOW, why is changing it better?) Even though I've never seen . in arg names, I do like that it fits well with existing multi-level config options. If a double character is important, maybe ::? (Although maybe that's too much like C++ namespaces, and maybe why my mind went to : as a namespace indicator.)
In D9516#149033, @mharbison72 wrote:Big picture, why do we need to be able to tell namespace parts from command parts?
To make sure the user understand they are stepping in an entire different realm with different rules.
In the standard namespace (no prefix) we garantee (or aims at) the lack of footgun and excellent backward compatibility.
The debug namespace should not be somewhere any normal user ever have to go (at least without a responsible staff member)
The admin namespace will have its own rules and its own "be careful, this is not a "normal" situation to be there.
So we want something more distincting than just a simple - that we could have for "command group" or readability like phab-send, phab-read, etc.So it sounds like more of a convention for these behavior properties than say, commands in the admin group requiring --yes-i-know-this-may-eat-my-data. We'll have to have to figure out how to convey that somehow. I see admin, for example, and think "I'm in charge of making this work for my group, and it sounds like it does what I want, so it's for me and just some extra characters to type". I don't have any suggestions on how to highlight these behaviors ATM.
I don't think the command in the admin namespace should especially be footgun, but they will be "less usual". If we only get the "I'm in charge of making this work for my group" people to use them, we reached our intended goal.
but the double dash really bothers me for some reason (maybe because it looks like a typo).
The more I have been looking at it, the more I agree. It look as if a space was forgotten before a --option. However we need something better.
maybe ":" would work? But I don't like that too much either, as I can't think of anything that uses that style.
Hum why not, we could give it a try (admin:strip). Maybe . (admin.strip).
If simple convention is driving this, I'm not sure that a one character change from - to : or . stands out in a meaningful way. (IOW, why is changing it better?) Even though I've never seen . in arg names, I do like that it fits well with existing multi-level config options. If a double character is important, maybe ::? (Although maybe that's too much like C++ namespaces, and maybe why my mind went to : as a namespace indicator.)
Actually, I think I like :: is a common way to refer to namespace so it feel appropriate.
The -- also bothers me and I came here to see if it had been discussed before accepting this patch.
I like : or :: as the namespace separator. I suppose we have a few months to change things before this ships. So I'll probably stamp this.
Path | Packages | |||
---|---|---|---|---|
M | contrib/perf.py (124 lines) | |||
M | tests/test-contrib-perf.t (136 lines) |
object.__setattr__(repo, '_clcachekey', None) | object.__setattr__(repo, '_clcachekey', None) | ||||
object.__setattr__(repo, '_clcache', None) | object.__setattr__(repo, '_clcache', None) | ||||
clearfilecache(repo.unfiltered(), 'changelog') | clearfilecache(repo.unfiltered(), 'changelog') | ||||
# perf commands | # perf commands | ||||
@command(b'perfwalk', formatteropts) | @command(b'perf--walk', formatteropts) | ||||
durin42: Why is this two dashes and not one?
(Here and elsewhere. I was surprised to see two and notโฆ | |||||
I took a time machine and answer that question last month ;-) https://www.mercurial-scm.org/pipermail/mercurial-devel/2020-December/144168.html marmoute: I took a time machine and answer that question last month ;-)
https://www.mercurial-scm. | |||||
I don't want to endlessly bikeshed this, but the double dash really bothers me for some reason (maybe because it looks like a typo). If we really need a marker for a namespace, maybe ":" would work? But I don't like that too much either, as I can't think of anything that uses that style. Big picture, why do we need to be able to tell namespace parts from command parts? My assumption was that namespaces would simply group commands in a related area (if a command list was sorted), or for a theoretical hg help $namespace. But presumably if we're defining namespaces, the code for that version of hg will know what namespaces are defined, and it's a simple prefix check without spilling implementation details into the UI. mharbison72: I don't want to endlessly bikeshed this, but the double dash really bothers me for some reasonโฆ | |||||
Now is precisely the good time to bikeshed this, (and as Augie pointed, we now have 3.5 month to change whatever pick we get).
The more I have been looking at it, the more I agree. It look as if a space was forgotten before a --option. However we need something better.
Hum why not, we could give it a try (admin:strip). Maybe . (admin.strip).
To make sure the user understand they are stepping in an entire different realm with different rules. In the standard namespace (no prefix) we garantee (or aims at) the lack of footgun and excellent backward compatibility. The debug namespace should not be somewhere any normal user ever have to go (at least without a responsible staff member) The admin namespace will have its own rules and its own "be careful, this is not a "normal" situation to be there. So we want something more distincting than just a simple - that we could have for "command group" or readability like phab-send, phab-read, etc. marmoute: > I don't want to endlessly bikeshed this,
Now is precisely the good time to bikeshed thisโฆ | |||||
def perfwalk(ui, repo, *pats, **opts): | def perfwalk(ui, repo, *pats, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
m = scmutil.match(repo[None], pats, {}) | m = scmutil.match(repo[None], pats, {}) | ||||
timer( | timer( | ||||
lambda: len( | lambda: len( | ||||
list( | list( | ||||
repo.dirstate.walk(m, subrepos=[], unknown=True, ignored=False) | repo.dirstate.walk(m, subrepos=[], unknown=True, ignored=False) | ||||
) | ) | ||||
) | ) | ||||
) | ) | ||||
fm.end() | fm.end() | ||||
@command(b'perfannotate', formatteropts) | @command(b'perf--annotate', formatteropts) | ||||
def perfannotate(ui, repo, f, **opts): | def perfannotate(ui, repo, f, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
fc = repo[b'.'][f] | fc = repo[b'.'][f] | ||||
timer(lambda: len(fc.annotate(True))) | timer(lambda: len(fc.annotate(True))) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfstatus', | b'perf--status', | ||||
[ | [ | ||||
(b'u', b'unknown', False, b'ask status to look for unknown files'), | (b'u', b'unknown', False, b'ask status to look for unknown files'), | ||||
(b'', b'dirstate', False, b'benchmark the internal dirstate call'), | (b'', b'dirstate', False, b'benchmark the internal dirstate call'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
) | ) | ||||
def perfstatus(ui, repo, **opts): | def perfstatus(ui, repo, **opts): | ||||
"""benchmark the performance of a single status call | """benchmark the performance of a single status call | ||||
sum(map(bool, s)) | sum(map(bool, s)) | ||||
timer(status_dirstate) | timer(status_dirstate) | ||||
else: | else: | ||||
timer(lambda: sum(map(len, repo.status(unknown=opts[b'unknown'])))) | timer(lambda: sum(map(len, repo.status(unknown=opts[b'unknown'])))) | ||||
fm.end() | fm.end() | ||||
@command(b'perfaddremove', formatteropts) | @command(b'perf--addremove', formatteropts) | ||||
def perfaddremove(ui, repo, **opts): | def perfaddremove(ui, repo, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
try: | try: | ||||
oldquiet = repo.ui.quiet | oldquiet = repo.ui.quiet | ||||
repo.ui.quiet = True | repo.ui.quiet = True | ||||
matcher = scmutil.match(repo[None]) | matcher = scmutil.match(repo[None]) | ||||
opts[b'dry_run'] = True | opts[b'dry_run'] = True | ||||
elif util.safehasattr(cl, b'_nodecache'): | elif util.safehasattr(cl, b'_nodecache'): | ||||
# <= hg-5.2 | # <= hg-5.2 | ||||
from mercurial.node import nullid, nullrev | from mercurial.node import nullid, nullrev | ||||
cl._nodecache = {nullid: nullrev} | cl._nodecache = {nullid: nullrev} | ||||
cl._nodepos = None | cl._nodepos = None | ||||
@command(b'perfheads', formatteropts) | @command(b'perf--heads', formatteropts) | ||||
def perfheads(ui, repo, **opts): | def perfheads(ui, repo, **opts): | ||||
"""benchmark the computation of a changelog heads""" | """benchmark the computation of a changelog heads""" | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
cl = repo.changelog | cl = repo.changelog | ||||
def s(): | def s(): | ||||
clearcaches(cl) | clearcaches(cl) | ||||
def d(): | def d(): | ||||
len(cl.headrevs()) | len(cl.headrevs()) | ||||
timer(d, setup=s) | timer(d, setup=s) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perftags', | b'perf--tags', | ||||
formatteropts | formatteropts | ||||
+ [ | + [ | ||||
(b'', b'clear-revlogs', False, b'refresh changelog and manifest'), | (b'', b'clear-revlogs', False, b'refresh changelog and manifest'), | ||||
], | ], | ||||
) | ) | ||||
def perftags(ui, repo, **opts): | def perftags(ui, repo, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
repocleartagscache = repocleartagscachefunc(repo) | repocleartagscache = repocleartagscachefunc(repo) | ||||
clearrevlogs = opts[b'clear_revlogs'] | clearrevlogs = opts[b'clear_revlogs'] | ||||
def s(): | def s(): | ||||
if clearrevlogs: | if clearrevlogs: | ||||
clearchangelog(repo) | clearchangelog(repo) | ||||
clearfilecache(repo.unfiltered(), 'manifest') | clearfilecache(repo.unfiltered(), 'manifest') | ||||
repocleartagscache() | repocleartagscache() | ||||
def t(): | def t(): | ||||
return len(repo.tags()) | return len(repo.tags()) | ||||
timer(t, setup=s) | timer(t, setup=s) | ||||
fm.end() | fm.end() | ||||
@command(b'perfancestors', formatteropts) | @command(b'perf--ancestors', formatteropts) | ||||
def perfancestors(ui, repo, **opts): | def perfancestors(ui, repo, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
heads = repo.changelog.headrevs() | heads = repo.changelog.headrevs() | ||||
def d(): | def d(): | ||||
for a in repo.changelog.ancestors(heads): | for a in repo.changelog.ancestors(heads): | ||||
pass | pass | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfancestorset', formatteropts) | @command(b'perf--ancestorset', formatteropts) | ||||
def perfancestorset(ui, repo, revset, **opts): | def perfancestorset(ui, repo, revset, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
revs = repo.revs(revset) | revs = repo.revs(revset) | ||||
heads = repo.changelog.headrevs() | heads = repo.changelog.headrevs() | ||||
def d(): | def d(): | ||||
s = repo.changelog.ancestors(heads) | s = repo.changelog.ancestors(heads) | ||||
for rev in revs: | for rev in revs: | ||||
rev in s | rev in s | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfdiscovery', formatteropts, b'PATH') | @command(b'perf--discovery', formatteropts, b'PATH') | ||||
def perfdiscovery(ui, repo, path, **opts): | def perfdiscovery(ui, repo, path, **opts): | ||||
"""benchmark discovery between local repo and the peer at given path""" | """benchmark discovery between local repo and the peer at given path""" | ||||
repos = [repo, None] | repos = [repo, None] | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
path = ui.expandpath(path) | path = ui.expandpath(path) | ||||
def s(): | def s(): | ||||
repos[1] = hg.peer(ui, opts, path) | repos[1] = hg.peer(ui, opts, path) | ||||
def d(): | def d(): | ||||
setdiscovery.findcommonheads(ui, *repos) | setdiscovery.findcommonheads(ui, *repos) | ||||
timer(d, setup=s) | timer(d, setup=s) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfbookmarks', | b'perf--bookmarks', | ||||
formatteropts | formatteropts | ||||
+ [ | + [ | ||||
(b'', b'clear-revlogs', False, b'refresh changelog and manifest'), | (b'', b'clear-revlogs', False, b'refresh changelog and manifest'), | ||||
], | ], | ||||
) | ) | ||||
def perfbookmarks(ui, repo, **opts): | def perfbookmarks(ui, repo, **opts): | ||||
"""benchmark parsing bookmarks from disk to memory""" | """benchmark parsing bookmarks from disk to memory""" | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
clearrevlogs = opts[b'clear_revlogs'] | clearrevlogs = opts[b'clear_revlogs'] | ||||
def s(): | def s(): | ||||
if clearrevlogs: | if clearrevlogs: | ||||
clearchangelog(repo) | clearchangelog(repo) | ||||
clearfilecache(repo, b'_bookmarks') | clearfilecache(repo, b'_bookmarks') | ||||
def d(): | def d(): | ||||
repo._bookmarks | repo._bookmarks | ||||
timer(d, setup=s) | timer(d, setup=s) | ||||
fm.end() | fm.end() | ||||
@command(b'perfbundleread', formatteropts, b'BUNDLE') | @command(b'perf--bundleread', formatteropts, b'BUNDLE') | ||||
def perfbundleread(ui, repo, bundlepath, **opts): | def perfbundleread(ui, repo, bundlepath, **opts): | ||||
"""Benchmark reading of bundle files. | """Benchmark reading of bundle files. | ||||
This command is meant to isolate the I/O part of bundle reading as | This command is meant to isolate the I/O part of bundle reading as | ||||
much as possible. | much as possible. | ||||
""" | """ | ||||
from mercurial import ( | from mercurial import ( | ||||
bundle2, | bundle2, | ||||
for fn, title in benches: | for fn, title in benches: | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
timer(fn, title=title) | timer(fn, title=title) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfchangegroupchangelog', | b'perf--changegroupchangelog', | ||||
formatteropts | formatteropts | ||||
+ [ | + [ | ||||
(b'', b'cgversion', b'02', b'changegroup version'), | (b'', b'cgversion', b'02', b'changegroup version'), | ||||
(b'r', b'rev', b'', b'revisions to add to changegroup'), | (b'r', b'rev', b'', b'revisions to add to changegroup'), | ||||
], | ], | ||||
) | ) | ||||
def perfchangegroupchangelog(ui, repo, cgversion=b'02', rev=None, **opts): | def perfchangegroupchangelog(ui, repo, cgversion=b'02', rev=None, **opts): | ||||
"""Benchmark producing a changelog group for a changegroup. | """Benchmark producing a changelog group for a changegroup. | ||||
# Terminal printing can interfere with timing. So disable it. | # Terminal printing can interfere with timing. So disable it. | ||||
with ui.configoverride({(b'progress', b'disable'): True}): | with ui.configoverride({(b'progress', b'disable'): True}): | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfdirs', formatteropts) | @command(b'perf--dirs', formatteropts) | ||||
def perfdirs(ui, repo, **opts): | def perfdirs(ui, repo, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
dirstate = repo.dirstate | dirstate = repo.dirstate | ||||
b'a' in dirstate | b'a' in dirstate | ||||
def d(): | def d(): | ||||
dirstate.hasdir(b'a') | dirstate.hasdir(b'a') | ||||
del dirstate._map._dirs | del dirstate._map._dirs | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfdirstate', | b'perf--dirstate', | ||||
[ | [ | ||||
( | ( | ||||
b'', | b'', | ||||
b'iteration', | b'iteration', | ||||
None, | None, | ||||
b'benchmark a full iteration for the dirstate', | b'benchmark a full iteration for the dirstate', | ||||
), | ), | ||||
( | ( | ||||
def d(): | def d(): | ||||
b"a" in repo.dirstate | b"a" in repo.dirstate | ||||
timer(d, setup=setup) | timer(d, setup=setup) | ||||
fm.end() | fm.end() | ||||
@command(b'perfdirstatedirs', formatteropts) | @command(b'perf--dirstatedirs', formatteropts) | ||||
def perfdirstatedirs(ui, repo, **opts): | def perfdirstatedirs(ui, repo, **opts): | ||||
"""benchmap a 'dirstate.hasdir' call from an empty `dirs` cache""" | """benchmap a 'dirstate.hasdir' call from an empty `dirs` cache""" | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
repo.dirstate.hasdir(b"a") | repo.dirstate.hasdir(b"a") | ||||
def setup(): | def setup(): | ||||
del repo.dirstate._map._dirs | del repo.dirstate._map._dirs | ||||
def d(): | def d(): | ||||
repo.dirstate.hasdir(b"a") | repo.dirstate.hasdir(b"a") | ||||
timer(d, setup=setup) | timer(d, setup=setup) | ||||
fm.end() | fm.end() | ||||
@command(b'perfdirstatefoldmap', formatteropts) | @command(b'perf--dirstatefoldmap', formatteropts) | ||||
def perfdirstatefoldmap(ui, repo, **opts): | def perfdirstatefoldmap(ui, repo, **opts): | ||||
"""benchmap a `dirstate._map.filefoldmap.get()` request | """benchmap a `dirstate._map.filefoldmap.get()` request | ||||
The dirstate filefoldmap cache is dropped between every request. | The dirstate filefoldmap cache is dropped between every request. | ||||
""" | """ | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
dirstate = repo.dirstate | dirstate = repo.dirstate | ||||
dirstate._map.filefoldmap.get(b'a') | dirstate._map.filefoldmap.get(b'a') | ||||
def setup(): | def setup(): | ||||
del dirstate._map.filefoldmap | del dirstate._map.filefoldmap | ||||
def d(): | def d(): | ||||
dirstate._map.filefoldmap.get(b'a') | dirstate._map.filefoldmap.get(b'a') | ||||
timer(d, setup=setup) | timer(d, setup=setup) | ||||
fm.end() | fm.end() | ||||
@command(b'perfdirfoldmap', formatteropts) | @command(b'perf--dirfoldmap', formatteropts) | ||||
def perfdirfoldmap(ui, repo, **opts): | def perfdirfoldmap(ui, repo, **opts): | ||||
"""benchmap a `dirstate._map.dirfoldmap.get()` request | """benchmap a `dirstate._map.dirfoldmap.get()` request | ||||
The dirstate dirfoldmap cache is dropped between every request. | The dirstate dirfoldmap cache is dropped between every request. | ||||
""" | """ | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
dirstate = repo.dirstate | dirstate = repo.dirstate | ||||
dirstate._map.dirfoldmap.get(b'a') | dirstate._map.dirfoldmap.get(b'a') | ||||
def setup(): | def setup(): | ||||
del dirstate._map.dirfoldmap | del dirstate._map.dirfoldmap | ||||
del dirstate._map._dirs | del dirstate._map._dirs | ||||
def d(): | def d(): | ||||
dirstate._map.dirfoldmap.get(b'a') | dirstate._map.dirfoldmap.get(b'a') | ||||
timer(d, setup=setup) | timer(d, setup=setup) | ||||
fm.end() | fm.end() | ||||
@command(b'perfdirstatewrite', formatteropts) | @command(b'perf--dirstatewrite', formatteropts) | ||||
def perfdirstatewrite(ui, repo, **opts): | def perfdirstatewrite(ui, repo, **opts): | ||||
"""benchmap the time it take to write a dirstate on disk""" | """benchmap the time it take to write a dirstate on disk""" | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
ds = repo.dirstate | ds = repo.dirstate | ||||
b"a" in ds | b"a" in ds | ||||
def setup(): | def setup(): | ||||
fromrev = scmutil.revsingle(repo, opts[b'base']) | fromrev = scmutil.revsingle(repo, opts[b'base']) | ||||
ancestor = repo[fromrev] | ancestor = repo[fromrev] | ||||
else: | else: | ||||
ancestor = wctx.ancestor(rctx) | ancestor = wctx.ancestor(rctx) | ||||
return (wctx, rctx, ancestor) | return (wctx, rctx, ancestor) | ||||
@command( | @command( | ||||
b'perfmergecalculate', | b'perf--mergecalculate', | ||||
[ | [ | ||||
(b'r', b'rev', b'.', b'rev to merge against'), | (b'r', b'rev', b'.', b'rev to merge against'), | ||||
(b'', b'from', b'', b'rev to merge from'), | (b'', b'from', b'', b'rev to merge from'), | ||||
(b'', b'base', b'', b'the revision to use as base'), | (b'', b'base', b'', b'the revision to use as base'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
) | ) | ||||
def perfmergecalculate(ui, repo, **opts): | def perfmergecalculate(ui, repo, **opts): | ||||
followcopies=True, | followcopies=True, | ||||
) | ) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfmergecopies', | b'perf--mergecopies', | ||||
[ | [ | ||||
(b'r', b'rev', b'.', b'rev to merge against'), | (b'r', b'rev', b'.', b'rev to merge against'), | ||||
(b'', b'from', b'', b'rev to merge from'), | (b'', b'from', b'', b'rev to merge from'), | ||||
(b'', b'base', b'', b'the revision to use as base'), | (b'', b'base', b'', b'the revision to use as base'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
) | ) | ||||
def perfmergecopies(ui, repo, **opts): | def perfmergecopies(ui, repo, **opts): | ||||
"""measure runtime of `copies.mergecopies`""" | """measure runtime of `copies.mergecopies`""" | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
wctx, rctx, ancestor = _getmergerevs(repo, opts) | wctx, rctx, ancestor = _getmergerevs(repo, opts) | ||||
def d(): | def d(): | ||||
# acceptremote is True because we don't want prompts in the middle of | # acceptremote is True because we don't want prompts in the middle of | ||||
# our benchmark | # our benchmark | ||||
copies.mergecopies(repo, wctx, rctx, ancestor) | copies.mergecopies(repo, wctx, rctx, ancestor) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfpathcopies', [], b"REV REV") | @command(b'perf--pathcopies', [], b"REV REV") | ||||
def perfpathcopies(ui, repo, rev1, rev2, **opts): | def perfpathcopies(ui, repo, rev1, rev2, **opts): | ||||
"""benchmark the copy tracing logic""" | """benchmark the copy tracing logic""" | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
ctx1 = scmutil.revsingle(repo, rev1, rev1) | ctx1 = scmutil.revsingle(repo, rev1, rev1) | ||||
ctx2 = scmutil.revsingle(repo, rev2, rev2) | ctx2 = scmutil.revsingle(repo, rev2, rev2) | ||||
def d(): | def d(): | ||||
copies.pathcopies(ctx1, ctx2) | copies.pathcopies(ctx1, ctx2) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfphases', | b'perf--phases', | ||||
[ | [ | ||||
(b'', b'full', False, b'include file reading time too'), | (b'', b'full', False, b'include file reading time too'), | ||||
], | ], | ||||
b"", | b"", | ||||
) | ) | ||||
def perfphases(ui, repo, **opts): | def perfphases(ui, repo, **opts): | ||||
"""benchmark phasesets computation""" | """benchmark phasesets computation""" | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
_phases = repo._phasecache | _phases = repo._phasecache | ||||
full = opts.get(b'full') | full = opts.get(b'full') | ||||
def d(): | def d(): | ||||
phases = _phases | phases = _phases | ||||
if full: | if full: | ||||
clearfilecache(repo, b'_phasecache') | clearfilecache(repo, b'_phasecache') | ||||
phases = repo._phasecache | phases = repo._phasecache | ||||
phases.invalidate() | phases.invalidate() | ||||
phases.loadphaserevs(repo) | phases.loadphaserevs(repo) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfphasesremote', [], b"[DEST]") | @command(b'perf--phasesremote', [], b"[DEST]") | ||||
def perfphasesremote(ui, repo, dest=None, **opts): | def perfphasesremote(ui, repo, dest=None, **opts): | ||||
"""benchmark time needed to analyse phases of the remote server""" | """benchmark time needed to analyse phases of the remote server""" | ||||
from mercurial.node import bin | from mercurial.node import bin | ||||
from mercurial import ( | from mercurial import ( | ||||
exchange, | exchange, | ||||
hg, | hg, | ||||
phases, | phases, | ||||
) | ) | ||||
def d(): | def d(): | ||||
phases.remotephasessummary(repo, remotesubset, remotephases) | phases.remotephasessummary(repo, remotesubset, remotephases) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfmanifest', | b'perf--manifest', | ||||
[ | [ | ||||
(b'm', b'manifest-rev', False, b'Look up a manifest node revision'), | (b'm', b'manifest-rev', False, b'Look up a manifest node revision'), | ||||
(b'', b'clear-disk', False, b'clear on-disk caches too'), | (b'', b'clear-disk', False, b'clear on-disk caches too'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
b'REV|NODE', | b'REV|NODE', | ||||
) | ) | ||||
def perfmanifest(ui, repo, rev, manifest_rev=False, clear_disk=False, **opts): | def perfmanifest(ui, repo, rev, manifest_rev=False, clear_disk=False, **opts): | ||||
def d(): | def d(): | ||||
repo.manifestlog.clearcaches(clear_persisted_data=clear_disk) | repo.manifestlog.clearcaches(clear_persisted_data=clear_disk) | ||||
repo.manifestlog[t].read() | repo.manifestlog[t].read() | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfchangeset', formatteropts) | @command(b'perf--changeset', formatteropts) | ||||
def perfchangeset(ui, repo, rev, **opts): | def perfchangeset(ui, repo, rev, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
n = scmutil.revsingle(repo, rev).node() | n = scmutil.revsingle(repo, rev).node() | ||||
def d(): | def d(): | ||||
repo.changelog.read(n) | repo.changelog.read(n) | ||||
# repo.changelog._cache = None | # repo.changelog._cache = None | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfignore', formatteropts) | @command(b'perf--ignore', formatteropts) | ||||
def perfignore(ui, repo, **opts): | def perfignore(ui, repo, **opts): | ||||
"""benchmark operation related to computing ignore""" | """benchmark operation related to computing ignore""" | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
dirstate = repo.dirstate | dirstate = repo.dirstate | ||||
def setupone(): | def setupone(): | ||||
dirstate.invalidate() | dirstate.invalidate() | ||||
clearfilecache(dirstate, b'_ignore') | clearfilecache(dirstate, b'_ignore') | ||||
def runone(): | def runone(): | ||||
dirstate._ignore | dirstate._ignore | ||||
timer(runone, setup=setupone, title=b"load") | timer(runone, setup=setupone, title=b"load") | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfindex', | b'perf--index', | ||||
[ | [ | ||||
(b'', b'rev', [], b'revision to be looked up (default tip)'), | (b'', b'rev', [], b'revision to be looked up (default tip)'), | ||||
(b'', b'no-lookup', None, b'do not revision lookup post creation'), | (b'', b'no-lookup', None, b'do not revision lookup post creation'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
) | ) | ||||
def perfindex(ui, repo, **opts): | def perfindex(ui, repo, **opts): | ||||
"""benchmark index creation time followed by a lookup | """benchmark index creation time followed by a lookup | ||||
for n in nodes: | for n in nodes: | ||||
cl.rev(n) | cl.rev(n) | ||||
timer(d, setup=setup) | timer(d, setup=setup) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfnodemap', | b'perf--nodemap', | ||||
[ | [ | ||||
(b'', b'rev', [], b'revision to be looked up (default tip)'), | (b'', b'rev', [], b'revision to be looked up (default tip)'), | ||||
(b'', b'clear-caches', True, b'clear revlog cache between calls'), | (b'', b'clear-caches', True, b'clear revlog cache between calls'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
) | ) | ||||
def perfnodemap(ui, repo, **opts): | def perfnodemap(ui, repo, **opts): | ||||
"""benchmark the time necessary to look up revision from a cold nodemap | """benchmark the time necessary to look up revision from a cold nodemap | ||||
else: | else: | ||||
setnodeget() | setnodeget() | ||||
d() # prewarm the data structure | d() # prewarm the data structure | ||||
timer(d, setup=setup) | timer(d, setup=setup) | ||||
fm.end() | fm.end() | ||||
@command(b'perfstartup', formatteropts) | @command(b'perf--startup', formatteropts) | ||||
def perfstartup(ui, repo, **opts): | def perfstartup(ui, repo, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
def d(): | def d(): | ||||
if os.name != 'nt': | if os.name != 'nt': | ||||
os.system( | os.system( | ||||
b"HGRCPATH= %s version -q > /dev/null" % fsencode(sys.argv[0]) | b"HGRCPATH= %s version -q > /dev/null" % fsencode(sys.argv[0]) | ||||
) | ) | ||||
else: | else: | ||||
os.environ['HGRCPATH'] = r' ' | os.environ['HGRCPATH'] = r' ' | ||||
os.system("%s version -q > NUL" % sys.argv[0]) | os.system("%s version -q > NUL" % sys.argv[0]) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfparents', formatteropts) | @command(b'perf--parents', formatteropts) | ||||
def perfparents(ui, repo, **opts): | def perfparents(ui, repo, **opts): | ||||
"""benchmark the time necessary to fetch one changeset's parents. | """benchmark the time necessary to fetch one changeset's parents. | ||||
The fetch is done using the `node identifier`, traversing all object layers | The fetch is done using the `node identifier`, traversing all object layers | ||||
from the repository object. The first N revisions will be used for this | from the repository object. The first N revisions will be used for this | ||||
benchmark. N is controlled by the ``perf.parentscount`` config option | benchmark. N is controlled by the ``perf.parentscount`` config option | ||||
(default: 1000). | (default: 1000). | ||||
""" | """ | ||||
def d(): | def d(): | ||||
for n in nl: | for n in nl: | ||||
repo.changelog.parents(n) | repo.changelog.parents(n) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfctxfiles', formatteropts) | @command(b'perf--ctxfiles', formatteropts) | ||||
def perfctxfiles(ui, repo, x, **opts): | def perfctxfiles(ui, repo, x, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
x = int(x) | x = int(x) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
def d(): | def d(): | ||||
len(repo[x].files()) | len(repo[x].files()) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfrawfiles', formatteropts) | @command(b'perf--rawfiles', formatteropts) | ||||
def perfrawfiles(ui, repo, x, **opts): | def perfrawfiles(ui, repo, x, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
x = int(x) | x = int(x) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
cl = repo.changelog | cl = repo.changelog | ||||
def d(): | def d(): | ||||
len(cl.read(x)[3]) | len(cl.read(x)[3]) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perflookup', formatteropts) | @command(b'perf--lookup', formatteropts) | ||||
def perflookup(ui, repo, rev, **opts): | def perflookup(ui, repo, rev, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
timer(lambda: len(repo.lookup(rev))) | timer(lambda: len(repo.lookup(rev))) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perflinelogedits', | b'perf--linelogedits', | ||||
[ | [ | ||||
(b'n', b'edits', 10000, b'number of edits'), | (b'n', b'edits', 10000, b'number of edits'), | ||||
(b'', b'max-hunk-lines', 10, b'max lines in a hunk'), | (b'', b'max-hunk-lines', 10, b'max lines in a hunk'), | ||||
], | ], | ||||
norepo=True, | norepo=True, | ||||
) | ) | ||||
def perflinelogedits(ui, **opts): | def perflinelogedits(ui, **opts): | ||||
from mercurial import linelog | from mercurial import linelog | ||||
for args in arglist: | for args in arglist: | ||||
ll.replacelines(*args) | ll.replacelines(*args) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfrevrange', formatteropts) | @command(b'perf--revrange', formatteropts) | ||||
def perfrevrange(ui, repo, *specs, **opts): | def perfrevrange(ui, repo, *specs, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
revrange = scmutil.revrange | revrange = scmutil.revrange | ||||
timer(lambda: len(revrange(repo, specs))) | timer(lambda: len(revrange(repo, specs))) | ||||
fm.end() | fm.end() | ||||
@command(b'perfnodelookup', formatteropts) | @command(b'perf--nodelookup', formatteropts) | ||||
def perfnodelookup(ui, repo, rev, **opts): | def perfnodelookup(ui, repo, rev, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
import mercurial.revlog | import mercurial.revlog | ||||
mercurial.revlog._prereadsize = 2 ** 24 # disable lazy parser in old hg | mercurial.revlog._prereadsize = 2 ** 24 # disable lazy parser in old hg | ||||
n = scmutil.revsingle(repo, rev).node() | n = scmutil.revsingle(repo, rev).node() | ||||
cl = mercurial.revlog.revlog(getsvfs(repo), b"00changelog.i") | cl = mercurial.revlog.revlog(getsvfs(repo), b"00changelog.i") | ||||
def d(): | def d(): | ||||
cl.rev(n) | cl.rev(n) | ||||
clearcaches(cl) | clearcaches(cl) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perflog', | b'perf--log', | ||||
[(b'', b'rename', False, b'ask log to follow renames')] + formatteropts, | [(b'', b'rename', False, b'ask log to follow renames')] + formatteropts, | ||||
) | ) | ||||
def perflog(ui, repo, rev=None, **opts): | def perflog(ui, repo, rev=None, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
if rev is None: | if rev is None: | ||||
rev = [] | rev = [] | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
ui.pushbuffer() | ui.pushbuffer() | ||||
timer( | timer( | ||||
lambda: commands.log( | lambda: commands.log( | ||||
ui, repo, rev=rev, date=b'', user=b'', copies=opts.get(b'rename') | ui, repo, rev=rev, date=b'', user=b'', copies=opts.get(b'rename') | ||||
) | ) | ||||
) | ) | ||||
ui.popbuffer() | ui.popbuffer() | ||||
fm.end() | fm.end() | ||||
@command(b'perfmoonwalk', formatteropts) | @command(b'perf--moonwalk', formatteropts) | ||||
def perfmoonwalk(ui, repo, **opts): | def perfmoonwalk(ui, repo, **opts): | ||||
"""benchmark walking the changelog backwards | """benchmark walking the changelog backwards | ||||
This also loads the changelog data for each revision in the changelog. | This also loads the changelog data for each revision in the changelog. | ||||
""" | """ | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
def moonwalk(): | def moonwalk(): | ||||
for i in repo.changelog.revs(start=(len(repo) - 1), stop=-1): | for i in repo.changelog.revs(start=(len(repo) - 1), stop=-1): | ||||
ctx = repo[i] | ctx = repo[i] | ||||
ctx.branch() # read changelog data (in addition to the index) | ctx.branch() # read changelog data (in addition to the index) | ||||
timer(moonwalk) | timer(moonwalk) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perftemplating', | b'perf--templating', | ||||
[ | [ | ||||
(b'r', b'rev', [], b'revisions to run the template on'), | (b'r', b'rev', [], b'revisions to run the template on'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
) | ) | ||||
def perftemplating(ui, repo, testedtemplate=None, **opts): | def perftemplating(ui, repo, testedtemplate=None, **opts): | ||||
"""test the rendering time of a given template""" | """test the rendering time of a given template""" | ||||
if makelogtemplater is None: | if makelogtemplater is None: | ||||
'max', | 'max', | ||||
] | ] | ||||
for l in lines: | for l in lines: | ||||
fm.plain('%s: %s\n' % (l, stats[l])) | fm.plain('%s: %s\n' % (l, stats[l])) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfhelper-mergecopies', | b'perf--helper-mergecopies', | ||||
formatteropts | formatteropts | ||||
+ [ | + [ | ||||
(b'r', b'revs', [], b'restrict search to these revisions'), | (b'r', b'revs', [], b'restrict search to these revisions'), | ||||
(b'', b'timing', False, b'provides extra data (costly)'), | (b'', b'timing', False, b'provides extra data (costly)'), | ||||
(b'', b'stats', False, b'provides statistic about the measured data'), | (b'', b'stats', False, b'provides statistic about the measured data'), | ||||
], | ], | ||||
) | ) | ||||
def perfhelpermergecopies(ui, repo, revs=[], **opts): | def perfhelpermergecopies(ui, repo, revs=[], **opts): | ||||
) | ) | ||||
entries.append(('totalnbrenames', 'total number of renames')) | entries.append(('totalnbrenames', 'total number of renames')) | ||||
entries.append(('parenttime', 'time for one parent')) | entries.append(('parenttime', 'time for one parent')) | ||||
entries.append(('totaltime', 'time for both parents')) | entries.append(('totaltime', 'time for both parents')) | ||||
_displaystats(ui, opts, entries, alldata) | _displaystats(ui, opts, entries, alldata) | ||||
@command( | @command( | ||||
b'perfhelper-pathcopies', | b'perf--helper-pathcopies', | ||||
formatteropts | formatteropts | ||||
+ [ | + [ | ||||
(b'r', b'revs', [], b'restrict search to these revisions'), | (b'r', b'revs', [], b'restrict search to these revisions'), | ||||
(b'', b'timing', False, b'provides extra data (costly)'), | (b'', b'timing', False, b'provides extra data (costly)'), | ||||
(b'', b'stats', False, b'provides statistic about the measured data'), | (b'', b'stats', False, b'provides statistic about the measured data'), | ||||
], | ], | ||||
) | ) | ||||
def perfhelperpathcopies(ui, repo, revs=[], **opts): | def perfhelperpathcopies(ui, repo, revs=[], **opts): | ||||
('nbmissingfiles', 'number of missing files at head'), | ('nbmissingfiles', 'number of missing files at head'), | ||||
] | ] | ||||
if dotiming: | if dotiming: | ||||
entries.append(('nbrenames', 'renamed files')) | entries.append(('nbrenames', 'renamed files')) | ||||
entries.append(('time', 'time')) | entries.append(('time', 'time')) | ||||
_displaystats(ui, opts, entries, alldata) | _displaystats(ui, opts, entries, alldata) | ||||
@command(b'perfcca', formatteropts) | @command(b'perf--cca', formatteropts) | ||||
def perfcca(ui, repo, **opts): | def perfcca(ui, repo, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
timer(lambda: scmutil.casecollisionauditor(ui, False, repo.dirstate)) | timer(lambda: scmutil.casecollisionauditor(ui, False, repo.dirstate)) | ||||
fm.end() | fm.end() | ||||
@command(b'perffncacheload', formatteropts) | @command(b'perf--fncacheload', formatteropts) | ||||
def perffncacheload(ui, repo, **opts): | def perffncacheload(ui, repo, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
s = repo.store | s = repo.store | ||||
def d(): | def d(): | ||||
s.fncache._load() | s.fncache._load() | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perffncachewrite', formatteropts) | @command(b'perf--fncachewrite', formatteropts) | ||||
def perffncachewrite(ui, repo, **opts): | def perffncachewrite(ui, repo, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
s = repo.store | s = repo.store | ||||
lock = repo.lock() | lock = repo.lock() | ||||
s.fncache._load() | s.fncache._load() | ||||
tr = repo.transaction(b'perffncachewrite') | tr = repo.transaction(b'perffncachewrite') | ||||
tr.addbackup(b'fncache') | tr.addbackup(b'fncache') | ||||
def d(): | def d(): | ||||
s.fncache._dirty = True | s.fncache._dirty = True | ||||
s.fncache.write(tr) | s.fncache.write(tr) | ||||
timer(d) | timer(d) | ||||
tr.close() | tr.close() | ||||
lock.release() | lock.release() | ||||
fm.end() | fm.end() | ||||
@command(b'perffncacheencode', formatteropts) | @command(b'perf--fncacheencode', formatteropts) | ||||
def perffncacheencode(ui, repo, **opts): | def perffncacheencode(ui, repo, **opts): | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
s = repo.store | s = repo.store | ||||
s.fncache._load() | s.fncache._load() | ||||
def d(): | def d(): | ||||
for p in s.fncache.entries: | for p in s.fncache.entries: | ||||
store = ml.getstorage(b'') | store = ml.getstorage(b'') | ||||
else: | else: | ||||
store = ml._revlog | store = ml._revlog | ||||
return store.revision(mnode) | return store.revision(mnode) | ||||
@command( | @command( | ||||
b'perfbdiff', | b'perf--bdiff', | ||||
revlogopts | revlogopts | ||||
+ formatteropts | + formatteropts | ||||
+ [ | + [ | ||||
( | ( | ||||
b'', | b'', | ||||
b'count', | b'count', | ||||
1, | 1, | ||||
b'number of revisions to test (when using --startrev)', | b'number of revisions to test (when using --startrev)', | ||||
done.set() | done.set() | ||||
for i in _xrange(threads): | for i in _xrange(threads): | ||||
q.put(None) | q.put(None) | ||||
with ready: | with ready: | ||||
ready.notify_all() | ready.notify_all() | ||||
@command( | @command( | ||||
b'perfunidiff', | b'perf--unidiff', | ||||
revlogopts | revlogopts | ||||
+ formatteropts | + formatteropts | ||||
+ [ | + [ | ||||
( | ( | ||||
b'', | b'', | ||||
b'count', | b'count', | ||||
1, | 1, | ||||
b'number of revisions to test (when using --startrev)', | b'number of revisions to test (when using --startrev)', | ||||
b'\n'.join(headerlines) | b'\n'.join(headerlines) | ||||
b''.join(sum((list(hlines) for hrange, hlines in hunks), [])) | b''.join(sum((list(hlines) for hrange, hlines in hunks), [])) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command(b'perfdiffwd', formatteropts) | @command(b'perf--diffwd', formatteropts) | ||||
def perfdiffwd(ui, repo, **opts): | def perfdiffwd(ui, repo, **opts): | ||||
"""Profile diff of working directory changes""" | """Profile diff of working directory changes""" | ||||
opts = _byteskwargs(opts) | opts = _byteskwargs(opts) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
options = { | options = { | ||||
'w': 'ignore_all_space', | 'w': 'ignore_all_space', | ||||
'b': 'ignore_space_change', | 'b': 'ignore_space_change', | ||||
'B': 'ignore_blank_lines', | 'B': 'ignore_blank_lines', | ||||
} | } | ||||
for diffopt in ('', 'w', 'b', 'B', 'wB'): | for diffopt in ('', 'w', 'b', 'B', 'wB'): | ||||
opts = {options[c]: b'1' for c in diffopt} | opts = {options[c]: b'1' for c in diffopt} | ||||
def d(): | def d(): | ||||
ui.pushbuffer() | ui.pushbuffer() | ||||
commands.diff(ui, repo, **opts) | commands.diff(ui, repo, **opts) | ||||
ui.popbuffer() | ui.popbuffer() | ||||
diffopt = diffopt.encode('ascii') | diffopt = diffopt.encode('ascii') | ||||
title = b'diffopts: %s' % (diffopt and (b'-' + diffopt) or b'none') | title = b'diffopts: %s' % (diffopt and (b'-' + diffopt) or b'none') | ||||
timer(d, title=title) | timer(d, title=title) | ||||
fm.end() | fm.end() | ||||
@command(b'perfrevlogindex', revlogopts + formatteropts, b'-c|-m|FILE') | @command(b'perf--revlogindex', revlogopts + formatteropts, b'-c|-m|FILE') | ||||
def perfrevlogindex(ui, repo, file_=None, **opts): | def perfrevlogindex(ui, repo, file_=None, **opts): | ||||
"""Benchmark operations against a revlog index. | """Benchmark operations against a revlog index. | ||||
This tests constructing a revlog instance, reading index data, | This tests constructing a revlog instance, reading index data, | ||||
parsing index data, and performing various operations related to | parsing index data, and performing various operations related to | ||||
index data. | index data. | ||||
""" | """ | ||||
for fn, title in benches: | for fn, title in benches: | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
timer(fn, title=title) | timer(fn, title=title) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfrevlogrevisions', | b'perf--revlogrevisions', | ||||
revlogopts | revlogopts | ||||
+ formatteropts | + formatteropts | ||||
+ [ | + [ | ||||
(b'd', b'dist', 100, b'distance between the revisions'), | (b'd', b'dist', 100, b'distance between the revisions'), | ||||
(b's', b'startrev', 0, b'revision to start reading at'), | (b's', b'startrev', 0, b'revision to start reading at'), | ||||
(b'', b'reverse', False, b'read in reverse'), | (b'', b'reverse', False, b'read in reverse'), | ||||
], | ], | ||||
b'-c|-m|FILE', | b'-c|-m|FILE', | ||||
rl.revision(n) | rl.revision(n) | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfrevlogwrite', | b'perf--revlogwrite', | ||||
revlogopts | revlogopts | ||||
+ formatteropts | + formatteropts | ||||
+ [ | + [ | ||||
(b's', b'startrev', 1000, b'revision to start writing at'), | (b's', b'startrev', 1000, b'revision to start writing at'), | ||||
(b'', b'stoprev', -1, b'last revision to write'), | (b'', b'stoprev', -1, b'last revision to write'), | ||||
(b'', b'count', 3, b'number of passes to perform'), | (b'', b'count', 3, b'number of passes to perform'), | ||||
(b'', b'details', False, b'print timing for every revisions tested'), | (b'', b'details', False, b'print timing for every revisions tested'), | ||||
(b'', b'source', b'full', b'the kind of data feed in the revlog'), | (b'', b'source', b'full', b'the kind of data feed in the revlog'), | ||||
dest.revision(len(dest) - 1) | dest.revision(len(dest) - 1) | ||||
yield dest | yield dest | ||||
del dest, vfs | del dest, vfs | ||||
finally: | finally: | ||||
shutil.rmtree(tmpdir, True) | shutil.rmtree(tmpdir, True) | ||||
@command( | @command( | ||||
b'perfrevlogchunks', | b'perf--revlogchunks', | ||||
revlogopts | revlogopts | ||||
+ formatteropts | + formatteropts | ||||
+ [ | + [ | ||||
(b'e', b'engines', b'', b'compression engines to use'), | (b'e', b'engines', b'', b'compression engines to use'), | ||||
(b's', b'startrev', 0, b'revision to start at'), | (b's', b'startrev', 0, b'revision to start at'), | ||||
], | ], | ||||
b'-c|-m|FILE', | b'-c|-m|FILE', | ||||
) | ) | ||||
for fn, title in benches: | for fn, title in benches: | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
timer(fn, title=title) | timer(fn, title=title) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfrevlogrevision', | b'perf--revlogrevision', | ||||
revlogopts | revlogopts | ||||
+ formatteropts | + formatteropts | ||||
+ [(b'', b'cache', False, b'use caches instead of clearing')], | + [(b'', b'cache', False, b'use caches instead of clearing')], | ||||
b'-c|-m|FILE REV', | b'-c|-m|FILE REV', | ||||
) | ) | ||||
def perfrevlogrevision(ui, repo, file_, rev=None, cache=None, **opts): | def perfrevlogrevision(ui, repo, file_, rev=None, cache=None, **opts): | ||||
"""Benchmark obtaining a revlog revision. | """Benchmark obtaining a revlog revision. | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
for fn, title in benches: | for fn, title in benches: | ||||
timer(fn, title=title) | timer(fn, title=title) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfrevset', | b'perf--revset', | ||||
[ | [ | ||||
(b'C', b'clear', False, b'clear volatile cache between each call.'), | (b'C', b'clear', False, b'clear volatile cache between each call.'), | ||||
(b'', b'contexts', False, b'obtain changectx for each revision'), | (b'', b'contexts', False, b'obtain changectx for each revision'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
b"REVSET", | b"REVSET", | ||||
) | ) | ||||
def perfrevset(ui, repo, expr, clear=False, contexts=False, **opts): | def perfrevset(ui, repo, expr, clear=False, contexts=False, **opts): | ||||
for r in repo.revs(expr): | for r in repo.revs(expr): | ||||
pass | pass | ||||
timer(d) | timer(d) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfvolatilesets', | b'perf--volatilesets', | ||||
[ | [ | ||||
(b'', b'clear-obsstore', False, b'drop obsstore between each call.'), | (b'', b'clear-obsstore', False, b'drop obsstore between each call.'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
) | ) | ||||
def perfvolatilesets(ui, repo, *names, **opts): | def perfvolatilesets(ui, repo, *names, **opts): | ||||
"""benchmark the computation of various volatile set | """benchmark the computation of various volatile set | ||||
allfilter = [n for n in allfilter if n in names] | allfilter = [n for n in allfilter if n in names] | ||||
for name in allfilter: | for name in allfilter: | ||||
timer(getfiltered(name), title=name) | timer(getfiltered(name), title=name) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfbranchmap', | b'perf--branchmap', | ||||
[ | [ | ||||
(b'f', b'full', False, b'Includes build time of subset'), | (b'f', b'full', False, b'Includes build time of subset'), | ||||
( | ( | ||||
b'', | b'', | ||||
b'clear-revbranch', | b'clear-revbranch', | ||||
False, | False, | ||||
b'purge the revbranch cache between computation', | b'purge the revbranch cache between computation', | ||||
), | ), | ||||
timer(getbranchmap(name), title=printname) | timer(getbranchmap(name), title=printname) | ||||
finally: | finally: | ||||
branchcacheread.restore() | branchcacheread.restore() | ||||
branchcachewrite.restore() | branchcachewrite.restore() | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfbranchmapupdate', | b'perf--branchmapupdate', | ||||
[ | [ | ||||
(b'', b'base', [], b'subset of revision to start from'), | (b'', b'base', [], b'subset of revision to start from'), | ||||
(b'', b'target', [], b'subset of revision to end with'), | (b'', b'target', [], b'subset of revision to end with'), | ||||
(b'', b'clear-caches', False, b'clear cache between each runs'), | (b'', b'clear-caches', False, b'clear cache between each runs'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
) | ) | ||||
def perfbranchmapupdate(ui, repo, base=(), target=(), **opts): | def perfbranchmapupdate(ui, repo, base=(), target=(), **opts): | ||||
timer(bench, setup=setup) | timer(bench, setup=setup) | ||||
fm.end() | fm.end() | ||||
finally: | finally: | ||||
repoview.filtertable.pop(b'__perf_branchmap_update_base', None) | repoview.filtertable.pop(b'__perf_branchmap_update_base', None) | ||||
repoview.filtertable.pop(b'__perf_branchmap_update_target', None) | repoview.filtertable.pop(b'__perf_branchmap_update_target', None) | ||||
@command( | @command( | ||||
b'perfbranchmapload', | b'perf--branchmapload', | ||||
[ | [ | ||||
(b'f', b'filter', b'', b'Specify repoview filter'), | (b'f', b'filter', b'', b'Specify repoview filter'), | ||||
(b'', b'list', False, b'List brachmap filter caches'), | (b'', b'list', False, b'List brachmap filter caches'), | ||||
(b'', b'clear-revlogs', False, b'refresh changelog and manifest'), | (b'', b'clear-revlogs', False, b'refresh changelog and manifest'), | ||||
] | ] | ||||
+ formatteropts, | + formatteropts, | ||||
) | ) | ||||
def perfbranchmapload(ui, repo, filter=b'', list=False, **opts): | def perfbranchmapload(ui, repo, filter=b'', list=False, **opts): | ||||
def bench(): | def bench(): | ||||
fromfile(repo) | fromfile(repo) | ||||
timer(bench, setup=setup) | timer(bench, setup=setup) | ||||
fm.end() | fm.end() | ||||
@command(b'perfloadmarkers') | @command(b'perf--loadmarkers') | ||||
def perfloadmarkers(ui, repo): | def perfloadmarkers(ui, repo): | ||||
"""benchmark the time to parse the on-disk markers for a repo | """benchmark the time to parse the on-disk markers for a repo | ||||
Result is the number of markers in the repo.""" | Result is the number of markers in the repo.""" | ||||
timer, fm = gettimer(ui) | timer, fm = gettimer(ui) | ||||
svfs = getsvfs(repo) | svfs = getsvfs(repo) | ||||
timer(lambda: len(obsolete.obsstore(svfs))) | timer(lambda: len(obsolete.obsstore(svfs))) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perflrucachedict', | b'perf--lrucachedict', | ||||
formatteropts | formatteropts | ||||
+ [ | + [ | ||||
(b'', b'costlimit', 0, b'maximum total cost of items in cache'), | (b'', b'costlimit', 0, b'maximum total cost of items in cache'), | ||||
(b'', b'mincost', 0, b'smallest cost of items in cache'), | (b'', b'mincost', 0, b'smallest cost of items in cache'), | ||||
(b'', b'maxcost', 100, b'maximum cost of items in cache'), | (b'', b'maxcost', 100, b'maximum cost of items in cache'), | ||||
(b'', b'size', 4, b'size of cache'), | (b'', b'size', 4, b'size of cache'), | ||||
(b'', b'gets', 10000, b'number of key lookups'), | (b'', b'gets', 10000, b'number of key lookups'), | ||||
(b'', b'sets', 10000, b'number of key sets'), | (b'', b'sets', 10000, b'number of key sets'), | ||||
for fn, title in benches: | for fn, title in benches: | ||||
timer, fm = gettimer(ui, opts) | timer, fm = gettimer(ui, opts) | ||||
timer(fn, title=title) | timer(fn, title=title) | ||||
fm.end() | fm.end() | ||||
@command( | @command( | ||||
b'perfwrite', | b'perf--write', | ||||
formatteropts | formatteropts | ||||
+ [ | + [ | ||||
(b'', b'write-method', b'write', b'ui write method'), | (b'', b'write-method', b'write', b'ui write method'), | ||||
(b'', b'nlines', 100, b'number of lines'), | (b'', b'nlines', 100, b'number of lines'), | ||||
(b'', b'nitems', 100, b'number of items (per line)'), | (b'', b'nitems', 100, b'number of items (per line)'), | ||||
(b'', b'item', b'x', b'item that is written'), | (b'', b'item', b'x', b'item that is written'), | ||||
(b'', b'batch-line', None, b'pass whole line to write method at once'), | (b'', b'batch-line', None, b'pass whole line to write method at once'), | ||||
(b'', b'flush-line', None, b'flush after each line'), | (b'', b'flush-line', None, b'flush after each line'), | ||||
hint=b"use 3.5 or later", | hint=b"use 3.5 or later", | ||||
) | ) | ||||
return orig(repo, cmd, file_, opts) | return orig(repo, cmd, file_, opts) | ||||
extensions.wrapfunction(cmdutil, b'openrevlog', openrevlog) | extensions.wrapfunction(cmdutil, b'openrevlog', openrevlog) | ||||
@command( | @command( | ||||
b'perfprogress', | b'perf--progress', | ||||
formatteropts | formatteropts | ||||
+ [ | + [ | ||||
(b'', b'topic', b'topic', b'topic for progress messages'), | (b'', b'topic', b'topic', b'topic for progress messages'), | ||||
(b'c', b'total', 1000000, b'total value we are progressing to'), | (b'c', b'total', 1000000, b'total value we are progressing to'), | ||||
], | ], | ||||
norepo=True, | norepo=True, | ||||
) | ) | ||||
def perfprogress(ui, topic=None, total=None, **opts): | def perfprogress(ui, topic=None, total=None, **opts): |
The default value is: '3.0-100, 10.0-3' | The default value is: '3.0-100, 10.0-3' | ||||
"stub" | "stub" | ||||
When set, benchmarks will only be run once, useful for testing (default: | When set, benchmarks will only be run once, useful for testing (default: | ||||
off) | off) | ||||
list of commands: | list of commands: | ||||
perfaddremove | perf--addremove | ||||
(no help text available) | (no help text available) | ||||
perfancestors | perf--ancestors | ||||
(no help text available) | (no help text available) | ||||
perfancestorset | perf--ancestorset | ||||
(no help text available) | (no help text available) | ||||
perfannotate (no help text available) | perf--annotate | ||||
perfbdiff benchmark a bdiff between revisions | (no help text available) | ||||
perfbookmarks | perf--bdiff benchmark a bdiff between revisions | ||||
perf--bookmarks | |||||
benchmark parsing bookmarks from disk to memory | benchmark parsing bookmarks from disk to memory | ||||
perfbranchmap | perf--branchmap | ||||
benchmark the update of a branchmap | benchmark the update of a branchmap | ||||
perfbranchmapload | perf--branchmapload | ||||
benchmark reading the branchmap | benchmark reading the branchmap | ||||
perfbranchmapupdate | perf--branchmapupdate | ||||
benchmark branchmap update from for <base> revs to <target> | benchmark branchmap update from for <base> revs to <target> | ||||
revs | revs | ||||
perfbundleread | perf--bundleread | ||||
Benchmark reading of bundle files. | Benchmark reading of bundle files. | ||||
perfcca (no help text available) | perf--cca (no help text available) | ||||
perfchangegroupchangelog | perf--changegroupchangelog | ||||
Benchmark producing a changelog group for a changegroup. | Benchmark producing a changelog group for a changegroup. | ||||
perfchangeset | perf--changeset | ||||
(no help text available) | |||||
perf--ctxfiles | |||||
(no help text available) | (no help text available) | ||||
perfctxfiles (no help text available) | perf--diffwd Profile diff of working directory changes | ||||
perfdiffwd Profile diff of working directory changes | perf--dirfoldmap | ||||
perfdirfoldmap | |||||
benchmap a 'dirstate._map.dirfoldmap.get()' request | benchmap a 'dirstate._map.dirfoldmap.get()' request | ||||
perfdirs (no help text available) | perf--dirs (no help text available) | ||||
perfdirstate benchmap the time of various distate operations | perf--dirstate | ||||
perfdirstatedirs | benchmap the time of various distate operations | ||||
perf--dirstatedirs | |||||
benchmap a 'dirstate.hasdir' call from an empty 'dirs' cache | benchmap a 'dirstate.hasdir' call from an empty 'dirs' cache | ||||
perfdirstatefoldmap | perf--dirstatefoldmap | ||||
benchmap a 'dirstate._map.filefoldmap.get()' request | benchmap a 'dirstate._map.filefoldmap.get()' request | ||||
perfdirstatewrite | perf--dirstatewrite | ||||
benchmap the time it take to write a dirstate on disk | benchmap the time it take to write a dirstate on disk | ||||
perfdiscovery | perf--discovery | ||||
benchmark discovery between local repo and the peer at given | benchmark discovery between local repo and the peer at given | ||||
path | path | ||||
perffncacheencode | perf--fncacheencode | ||||
(no help text available) | (no help text available) | ||||
perffncacheload | perf--fncacheload | ||||
(no help text available) | (no help text available) | ||||
perffncachewrite | perf--fncachewrite | ||||
(no help text available) | (no help text available) | ||||
perfheads benchmark the computation of a changelog heads | perf--heads benchmark the computation of a changelog heads | ||||
perfhelper-mergecopies | perf--helper-mergecopies | ||||
find statistics about potential parameters for | find statistics about potential parameters for | ||||
'perfmergecopies' | 'perfmergecopies' | ||||
perfhelper-pathcopies | perf--helper-pathcopies | ||||
find statistic about potential parameters for the | find statistic about potential parameters for the | ||||
'perftracecopies' | 'perftracecopies' | ||||
perfignore benchmark operation related to computing ignore | perf--ignore benchmark operation related to computing ignore | ||||
perfindex benchmark index creation time followed by a lookup | perf--index benchmark index creation time followed by a lookup | ||||
perflinelogedits | perf--linelogedits | ||||
(no help text available) | (no help text available) | ||||
perfloadmarkers | perf--loadmarkers | ||||
benchmark the time to parse the on-disk markers for a repo | benchmark the time to parse the on-disk markers for a repo | ||||
perflog (no help text available) | perf--log (no help text available) | ||||
perflookup (no help text available) | perf--lookup (no help text available) | ||||
perflrucachedict | perf--lrucachedict | ||||
(no help text available) | (no help text available) | ||||
perfmanifest benchmark the time to read a manifest from disk and return a | perf--manifest | ||||
benchmark the time to read a manifest from disk and return a | |||||
usable | usable | ||||
perfmergecalculate | perf--mergecalculate | ||||
(no help text available) | (no help text available) | ||||
perfmergecopies | perf--mergecopies | ||||
measure runtime of 'copies.mergecopies' | measure runtime of 'copies.mergecopies' | ||||
perfmoonwalk benchmark walking the changelog backwards | perf--moonwalk | ||||
perfnodelookup | benchmark walking the changelog backwards | ||||
perf--nodelookup | |||||
(no help text available) | (no help text available) | ||||
perfnodemap benchmark the time necessary to look up revision from a cold | perf--nodemap | ||||
benchmark the time necessary to look up revision from a cold | |||||
nodemap | nodemap | ||||
perfparents benchmark the time necessary to fetch one changeset's parents. | perf--parents | ||||
perfpathcopies | benchmark the time necessary to fetch one changeset's parents. | ||||
perf--pathcopies | |||||
benchmark the copy tracing logic | benchmark the copy tracing logic | ||||
perfphases benchmark phasesets computation | perf--phases benchmark phasesets computation | ||||
perfphasesremote | perf--phasesremote | ||||
benchmark time needed to analyse phases of the remote server | benchmark time needed to analyse phases of the remote server | ||||
perfprogress printing of progress bars | perf--progress | ||||
perfrawfiles (no help text available) | printing of progress bars | ||||
perfrevlogchunks | perf--rawfiles | ||||
(no help text available) | |||||
perf--revlogchunks | |||||
Benchmark operations on revlog chunks. | Benchmark operations on revlog chunks. | ||||
perfrevlogindex | perf--revlogindex | ||||
Benchmark operations against a revlog index. | Benchmark operations against a revlog index. | ||||
perfrevlogrevision | perf--revlogrevision | ||||
Benchmark obtaining a revlog revision. | Benchmark obtaining a revlog revision. | ||||
perfrevlogrevisions | perf--revlogrevisions | ||||
Benchmark reading a series of revisions from a revlog. | Benchmark reading a series of revisions from a revlog. | ||||
perfrevlogwrite | perf--revlogwrite | ||||
Benchmark writing a series of revisions to a revlog. | Benchmark writing a series of revisions to a revlog. | ||||
perfrevrange (no help text available) | perf--revrange | ||||
perfrevset benchmark the execution time of a revset | (no help text available) | ||||
perfstartup (no help text available) | perf--revset benchmark the execution time of a revset | ||||
perfstatus benchmark the performance of a single status call | perf--startup | ||||
perftags (no help text available) | (no help text available) | ||||
perftemplating | perf--status benchmark the performance of a single status call | ||||
perf--tags (no help text available) | |||||
perf--templating | |||||
test the rendering time of a given template | test the rendering time of a given template | ||||
perfunidiff benchmark a unified diff between revisions | perf--unidiff | ||||
perfvolatilesets | benchmark a unified diff between revisions | ||||
perf--volatilesets | |||||
benchmark the computation of various volatile set | benchmark the computation of various volatile set | ||||
perfwalk (no help text available) | perf--walk (no help text available) | ||||
perfwrite microbenchmark ui.write (and others) | perf--write microbenchmark ui.write (and others) | ||||
(use 'hg help -v perf' to show built-in aliases and global options) | (use 'hg help -v perf' to show built-in aliases and global options) | ||||
$ hg perfaddremove | $ hg perfaddremove | ||||
$ hg perfancestors | $ hg perfancestors | ||||
$ hg perfancestorset 2 | $ hg perfancestorset 2 | ||||
$ hg perfannotate a | $ hg perfannotate a | ||||
$ hg perfbdiff -c 1 | $ hg perfbdiff -c 1 | ||||
$ hg perfbdiff --alldata 1 | $ hg perfbdiff --alldata 1 |
Why is this two dashes and not one?
(Here and elsewhere. I was surprised to see two and not one, and I don't know what that signifies...)