changeset 43240:4353942be294

tracing: add a couple of trace points on obsolete and repoview I was seeing weird stalls in some fast commands, and these trace events help explain them. Differential Revision: https://phab.mercurial-scm.org/D6550
author Augie Fackler <augie@google.com>
date Wed, 19 Jun 2019 18:22:10 -0400
parents 6fcdcea2b03a
children cca3c1755224
files mercurial/obsolete.py mercurial/repoview.py
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsolete.py	Tue Oct 15 11:05:32 2019 -0400
+++ b/mercurial/obsolete.py	Wed Jun 19 18:22:10 2019 -0400
@@ -899,11 +899,12 @@
 
     Such access may compute the set and cache it for future use"""
     repo = repo.unfiltered()
-    if not repo.obsstore:
-        return frozenset()
-    if name not in repo.obsstore.caches:
-        repo.obsstore.caches[name] = cachefuncs[name](repo)
-    return repo.obsstore.caches[name]
+    with util.timedcm('getrevs %s', name):
+        if not repo.obsstore:
+            return frozenset()
+        if name not in repo.obsstore.caches:
+            repo.obsstore.caches[name] = cachefuncs[name](repo)
+        return repo.obsstore.caches[name]
 
 
 # To be simple we need to invalidate obsolescence cache when:
--- a/mercurial/repoview.py	Tue Oct 15 11:05:32 2019 -0400
+++ b/mercurial/repoview.py	Wed Jun 19 18:22:10 2019 -0400
@@ -274,8 +274,8 @@
         unfiindex = unfichangelog.index
         unfilen = len(unfiindex)
         unfinode = unfiindex[unfilen - 1][7]
-
-        revs = filterrevs(unfi, self.filtername, self._visibilityexceptions)
+        with util.timedcm('repo filter for %s', self.filtername):
+            revs = filterrevs(unfi, self.filtername, self._visibilityexceptions)
         cl = self._clcache
         newkey = (unfilen, unfinode, hash(revs), unfichangelog._delayed)
         # if cl.index is not unfiindex, unfi.changelog would be