[PATCH 5 of 7] perf: add a no-lookup variant to perfindex

Pulkit Goyal 7895pulkit at gmail.com
Mon Jan 28 17:01:32 EST 2019


On Tue, Jan 29, 2019 at 3:30 AM Pulkit Goyal <7895pulkit at gmail.com> wrote:

>
>
> On Tue, Jan 29, 2019 at 1:49 AM Boris Feld <boris.feld at octobus.net> wrote:
>
>> # HG changeset patch
>> # User Boris Feld <boris.feld at octobus.net>
>> # Date 1548459828 18000
>> #      Fri Jan 25 18:43:48 2019 -0500
>> # Node ID 2518d5acdc4e994193ca5b70f945983a61e22ff5
>> # Parent  9a0d513d684855e3fbdd023c1fe84e7bad6579c4
>> # EXP-Topic perf-ext
>> # Available At https://bitbucket.org/octobus/mercurial-devel/
>> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
>> 2518d5acdc4e
>> perf: add a no-lookup variant to perfindex
>>
>> It is useful to check how long it takes to create a index object without
>> doing
>> anything with it. We add a new flag dedicated to that.
>>
>> diff --git a/contrib/perf.py b/contrib/perf.py
>> --- a/contrib/perf.py
>> +++ b/contrib/perf.py
>> @@ -1017,6 +1017,7 @@ def perfignore(ui, repo, **opts):
>>
>>  @command(b'perfindex', [
>>              (b'', b'rev', b'', b'revision to be looked up (default
>> tip)'),
>> +            (b'', b'no-lookup', None, b'do not revision lookup post
>> creation'),
>>           ] + formatteropts)
>>  def perfindex(ui, repo, **opts):
>>      """benchmark index creation time followed by a lookup
>> @@ -1031,7 +1032,9 @@ def perfindex(ui, repo, **opts):
>>      opts = _byteskwargs(opts)
>>      timer, fm = gettimer(ui, opts)
>>      mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
>> -    if opts[b'rev'] is None:
>> +    if opts[b'no_lookup']:
>> +        n = None
>> +    elif opts[b'rev'] is None:
>>          n = repo[b"tip"].node()
>>
>
> We should disallow passing both '--no-lookup' and '--rev'.
>

Ignore this. I see you have done that in next patch.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20190129/06200b2e/attachment.html>


More information about the Mercurial-devel mailing list