Patchwork [4,of,7] perf: add some documentation to perfindex

mail settings
Submitter Boris Feld
Date Jan. 28, 2019, 8:10 p.m.
Message ID <9a0d513d684855e3fbdd.1548706256@localhost.localdomain>
Download mbox | patch
Permalink /patch/38144/
State Accepted
Headers show


Boris Feld - Jan. 28, 2019, 8:10 p.m.
# HG changeset patch
# User Boris Feld <>
# Date 1548668860 18000
#      Mon Jan 28 04:47:40 2019 -0500
# Node ID 9a0d513d684855e3fbdd023c1fe84e7bad6579c4
# Parent  1e7a5bec6326c537b65ffb59b51c4bb34ea189cc
# EXP-Topic perf-ext
# Available At
#              hg pull -r 9a0d513d6848
perf: add some documentation to perfindex

It seems useful to document how the arguments can affect the benchmark.


diff --git a/contrib/ b/contrib/
--- a/contrib/
+++ b/contrib/
@@ -1019,6 +1019,14 @@  def perfignore(ui, repo, **opts):
             (b'', b'rev', b'', b'revision to be looked up (default tip)'),
          ] + formatteropts)
 def perfindex(ui, repo, **opts):
+    """benchmark index creation time followed by a lookup
+    The default is to look `tip` up. Depending on the index implementation,
+    the revision looked up can matters. For example, an implementation
+    scanning the index will have a faster lookup time for `--rev tip` than for
+    `--rev 0`.
+    It is not currently possible to check for lookup of a missing node."""
     import mercurial.revlog
     opts = _byteskwargs(opts)
     timer, fm = gettimer(ui, opts)
diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t
--- a/tests/test-contrib-perf.t
+++ b/tests/test-contrib-perf.t
@@ -93,7 +93,7 @@  perfstatus
                  find statistic about potential parameters for the
    perfignore    benchmark operation related to computing ignore
-   perfindex     (no help text available)
+   perfindex     benchmark index creation time followed by a lookup
                  (no help text available)