contrib/perf.py
changeset 40750 45a0047c0ebc
parent 40747 380a1f73830f
child 40768 f723014677a5
--- a/contrib/perf.py	Mon Nov 26 15:36:06 2018 +0300
+++ b/contrib/perf.py	Thu Nov 22 21:00:13 2018 +0100
@@ -975,6 +975,23 @@
     timer(d)
     fm.end()
 
+@command(b'perfignore', formatteropts)
+def perfignore(ui, repo, **opts):
+    """benchmark operation related to computing ignore"""
+    opts = _byteskwargs(opts)
+    timer, fm = gettimer(ui, opts)
+    dirstate = repo.dirstate
+
+    def setupone():
+        dirstate.invalidate()
+        clearfilecache(dirstate, b'_ignore')
+
+    def runone():
+        dirstate._ignore
+
+    timer(runone, setup=setupone, title=b"load")
+    fm.end()
+
 @command(b'perfindex', formatteropts)
 def perfindex(ui, repo, **opts):
     import mercurial.revlog