Patchwork D6172: remotefilelog: prefetch files in deterministic order

login
register
mail settings
Submitter phabricator
Date March 27, 2019, 10:11 p.m.
Message ID <differential-rev-PHID-DREV-7ghbqf5gigpkr6yjkabf-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39409/
State Superseded
Headers show

Comments

phabricator - March 27, 2019, 10:11 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I have been troubleshooting some slowness in this area (it's unclear
  if it's the client or server that's to blame, but that's beside the
  point) and it's a lot easier to do troubleshoot if the files are
  prefetched in the same order each time.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/remotefilelog/fileserverclient.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/remotefilelog/fileserverclient.py b/hgext/remotefilelog/fileserverclient.py
--- a/hgext/remotefilelog/fileserverclient.py
+++ b/hgext/remotefilelog/fileserverclient.py
@@ -544,7 +544,7 @@ 
                     if fetchwarning:
                         self.ui.warn(fetchwarning + '\n')
                 self.logstacktrace()
-            missingids = [(file, hex(id)) for file, id in missingids]
+            missingids = [(file, hex(id)) for file, id in sorted(missingids)]
             fetched += len(missingids)
             start = time.time()
             missingids = self.request(missingids)