changeset 32733:2b0a8b0f3435

perf: add a perfbookmarks command A new command dedicated to benchmark of bookmark initialization.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 07 Jun 2017 18:22:11 +0100
parents e36569bd9e28
children b5613bda454e
files contrib/perf.py tests/test-contrib-perf.t
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Tue May 23 02:27:41 2017 +0200
+++ b/contrib/perf.py	Wed Jun 07 18:22:11 2017 +0100
@@ -467,6 +467,16 @@
     timer(d)
     fm.end()
 
+@command('perfbookmarks', formatteropts)
+def perfbookmarks(ui, repo, **opts):
+    """benchmark parsing bookmarks from disk to memory"""
+    timer, fm = gettimer(ui, opts)
+    def d():
+        clearfilecache(repo, '_bookmarks')
+        repo._bookmarks
+    timer(d)
+    fm.end()
+
 @command('perfchangegroupchangelog', formatteropts +
          [('', 'version', '02', 'changegroup version'),
           ('r', 'rev', '', 'revisions to add to changegroup')])
--- a/tests/test-contrib-perf.t	Tue May 23 02:27:41 2017 +0200
+++ b/tests/test-contrib-perf.t	Wed Jun 07 18:22:11 2017 +0100
@@ -51,6 +51,8 @@
                  (no help text available)
    perfannotate  (no help text available)
    perfbdiff     benchmark a bdiff between revisions
+   perfbookmarks
+                 benchmark parsing bookmarks from disk to memory
    perfbranchmap
                  benchmark the update of a branchmap
    perfcca       (no help text available)
@@ -122,6 +124,7 @@
   $ hg perfannotate a
   $ hg perfbdiff -c 1
   $ hg perfbdiff --alldata 1
+  $ hg perfbookmarks
   $ hg perfbranchmap
   $ hg perfcca
   $ hg perfchangegroupchangelog