Patchwork D6549: localrepo: split lookup of context from status call

login
register
mail settings
Submitter phabricator
Date June 19, 2019, 8:26 p.m.
Message ID <differential-rev-PHID-DREV-hdabu4az2owvc76dyszz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/40608/
State Superseded
Headers show

Comments

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

REVISION SUMMARY
  In my clone of hg, this call of repo.__getitem__ is taking
  59ms. That's longer than walking the directory takes!

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2781,8 +2781,10 @@ 
                ignored=False, clean=False, unknown=False,
                listsubrepos=False):
         '''a convenience method that calls node1.status(node2)'''
-        return self[node1].status(node2, match, ignored, clean, unknown,
-                                  listsubrepos)
+        with util.timedcm('repo.status look up node1 context %r', node1):
+            n1 = self[node1]
+        return n1.status(node2, match, ignored, clean, unknown,
+                         listsubrepos)
 
     def addpostdsstatus(self, ps):
         """Add a callback to run within the wlock, at the point at which status