D5532: context: schedule file prefetch before comparing for cleanliness

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Tue Jan 8 22:34:18 UTC 2019


spectral created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  When using a system like remotefilelog, we can occasionally run into scenarios
  where the local content cache does not have the data we need to perform these
  comparisons. These will be fetched on-demand, but individually; if the
  remotefilelog server isn't extremely low latency, the runtime of the command
  becomes dominated by the multiple getfile requests for individual files.
  
  By performing the prefetch, we can download these files in bulk, and save server
  resources and many network roundtrips.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -2018,6 +2018,12 @@
         to resolve a conflict.
         """
         keys = []
+        # This won't be perfect, but can help performance significantly when
+        # using things like remotefilelog.
+        scmutil.prefetchfiles(
+            self.repo(), [self.p1().rev()],
+            matchmod.match('', '', patterns=self._cache.keys(), exact=True))
+
         for path in self._cache.keys():
             cache = self._cache[path]
             try:



To: spectral, #hg-reviewers
Cc: mjpieters, mercurial-devel


More information about the Mercurial-devel mailing list