Patchwork D6550: tracing: add a couple of trace points on obsolete and repoview

login
register
mail settings
Submitter phabricator
Date June 19, 2019, 10:23 p.m.
Message ID <differential-rev-PHID-DREV-vorphrtniu4f2qcyi6k2-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/40616/
State New
Headers show

Comments

phabricator - June 19, 2019, 10:23 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I was seeing weird stalls in some fast commands, and these trace
  events help explain them.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6550

AFFECTED FILES
  mercurial/obsolete.py
  mercurial/repoview.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -257,8 +257,9 @@ 
         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
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -832,11 +832,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:
 #