perf: add perfchangeset to time changeset parsing
authorMatt Mackall <mpm@selenic.com>
Thu, 15 Mar 2012 15:58:55 -0500
changeset 16262 bf7a6c3b2a4a
parent 16261 7b9bf72430ba
child 16263 be92ddc636e3
perf: add perfchangeset to time changeset parsing
contrib/perf.py
--- a/contrib/perf.py	Thu Mar 15 13:11:42 2012 -0500
+++ b/contrib/perf.py	Thu Mar 15 15:58:55 2012 -0500
@@ -79,6 +79,13 @@
         repo.manifest._cache = None
     timer(d)
 
+def perfchangeset(ui, repo, rev):
+    n = repo[rev].node()
+    def d():
+        c = repo.changelog.read(n)
+        repo.changelog._cache = None
+    timer(d)
+
 def perfindex(ui, repo):
     import mercurial.revlog
     mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
@@ -151,6 +158,7 @@
     'perfstatus': (perfstatus, []),
     'perfwalk': (perfwalk, []),
     'perfmanifest': (perfmanifest, []),
+    'perfchangeset': (perfchangeset, []),
     'perfindex': (perfindex, []),
     'perfheads': (perfheads, []),
     'perftags': (perftags, []),