changeset 16262:bf7a6c3b2a4a

perf: add perfchangeset to time changeset parsing
author Matt Mackall <mpm@selenic.com>
date Thu, 15 Mar 2012 15:58:55 -0500
parents 7b9bf72430ba
children be92ddc636e3
files contrib/perf.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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, []),