Patchwork [3,of,6,V2] perf: add a perfloadmarkers command

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 4, 2014, 3:16 p.m.
Message ID <d046747f367d29efd5fc.1417706176@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/6998/
State Accepted
Headers show

Comments

Pierre-Yves David - Dec. 4, 2014, 3:16 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1416529675 28800
#      Thu Nov 20 16:27:55 2014 -0800
# Node ID d046747f367d29efd5fc1802d7f37be8bc416125
# Parent  a57059d6ce3c918719db5c383c95c8f62179bb80
perf: add a perfloadmarkers command

It is used to perfmark the obsstore initialisation time.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -523,5 +523,14 @@  def perfbranchmap(ui, repo, full=False):
             timer(getbranchmap(name), title=str(name))
     finally:
         branchmap.read = oldread
         branchmap.branchcache.write = oldwrite
     fm.end()
+
+@command('perfloadmarkers')
+def perfloadmarkers(ui, repo):
+    """benchmark the time to parse the ondisk marker for a repo
+
+    Result is the number of marker in the repo."""
+    timer, fm = gettimer(ui)
+    timer(lambda: len(obsolete.obsstore(repo.sopener)))
+    fm.end()