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

2019-01-28 Thread Pulkit Goyal
On Tue, Jan 29, 2019 at 3:30 AM Pulkit Goyal <7895pul...@gmail.com> wrote:

>
>
> On Tue, Jan 29, 2019 at 1:49 AM Boris Feld  wrote:
>
>> # HG changeset patch
>> # User Boris Feld 
>> # 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.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


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

2019-01-28 Thread Pulkit Goyal
On Tue, Jan 29, 2019 at 1:49 AM Boris Feld  wrote:

> # HG changeset patch
> # User Boris Feld 
> # 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'.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


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

2019-01-28 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# 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()
 else:
 rev = scmutil.revsingle(repo, opts[b'rev'])
@@ -1046,7 +1049,8 @@ def perfindex(ui, repo, **opts):
 clearchangelog(unfi)
 def d():
 cl = makecl(unfi)
-cl.rev(n)
+if n is not None:
+cl.rev(n)
 timer(d, setup=setup)
 fm.end()
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel