[PATCH 1 of 2] contrib: add test to measure conversion time from a flat to a tree manifest

Laurent Charignon lcharignon at fb.com
Thu Feb 4 17:27:09 UTC 2016


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1454539797 28800
#      Wed Feb 03 14:49:57 2016 -0800
# Branch stable
# Node ID 241c38b8b3acbf8d2ab57fa85a38e337ef4e2472
# Parent  88609cfa37455815e4d6acd45e2a8893720c065b
contrib: add test to measure conversion time from a flat to a tree manifest

This will allow to measure performance improvement in following patches.

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -414,6 +414,17 @@
     ui.popbuffer()
     fm.end()
 
+ at command('perftreemanifesttotext', formatteropts)
+def perftreemanifesttotext(ui, repo, **opts):
+    from mercurial import manifest
+    timer, fm = gettimer(ui, opts)
+    m = repo['.'].manifest()
+    tree = manifest.treemanifest(text=m.text())
+    def d():
+        tree.text()
+    timer(d)
+    fm.end()
+
 @command('perfcca', formatteropts)
 def perfcca(ui, repo, **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
@@ -100,6 +100,8 @@
    perftags      (no help text available)
    perftemplating
                  (no help text available)
+   perftreemanifesttotext
+                 (no help text available)
    perfvolatilesets
                  benchmark the computation of various volatile set
    perfwalk      (no help text available)


More information about the Mercurial-devel mailing list