# HG changeset patch # User Augie Fackler # Date 2019-06-19 22:22:10 # Node ID 4353942be294e84b042a31a720c28af43095337a # Parent 6fcdcea2b03abfe450d8a7d01bbde38e56e3c97d 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 diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -899,11 +899,12 @@ def getrevs(repo, name): 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: diff --git a/mercurial/repoview.py b/mercurial/repoview.py --- a/mercurial/repoview.py +++ b/mercurial/repoview.py @@ -274,8 +274,8 @@ class repoview(object): 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