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

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2019, 2:22 p.m.
Message ID <efc331d008a43a81dea8924ed87a9733@localhost.localdomain>
Download mbox | patch
Permalink /patch/42392/
State Not Applicable
Headers show

Comments

phabricator - Oct. 16, 2019, 2:22 p.m.
Closed by commit rHG149d6ba20d9a: tracing: add a couple of trace points on obsolete and repoview (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6550?vs=17180&id=17209

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6550/new/

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

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

CHANGE DETAILS




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

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -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
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -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: