Submitter | phabricator |
---|---|
Date | Nov. 8, 2019, 9:09 a.m. |
Message ID | <differential-rev-PHID-DREV-qty26k2sanjdpwetvawk-req@mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/42908/ |
State | Superseded |
Headers | show |
Comments
This revision now requires changes to proceed. martinvonz added inline comments. martinvonz requested changes to this revision. INLINE COMMENTS > dirstate.py:1125 > + os.environ.setdefault('RAYON_NUM_THREADS', > + pycompat.sysstr(str(numcpus))) > + Is is the pycompat call needed? Same below. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7310/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7310 To: Alphare, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel
Alphare added a comment. You're right, it shouldn't REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7310/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7310 To: Alphare, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel
mharbison72 added inline comments. INLINE COMMENTS > dirstate.py:1119 > + > + workers_enabled = self._ui.configbool("worker", "enabled", True) > + if not workers_enabled: Isn't the default parameter usually omitted, and picked up from the registrar? REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7310/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7310 To: Alphare, #hg-reviewers, martinvonz Cc: mharbison72, martinvonz, mercurial-devel
Patch
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -1116,6 +1116,18 @@ use_rust = False if use_rust: + # Force Rayon (Rust parallelism library) to respect the number of + # workers. This is a temporary workaround until Rust code knows + # how to read the config file. + numcpus = self._ui.configint("worker", "numcpus") + if numcpus is not None: + os.environ.setdefault('RAYON_NUM_THREADS', + pycompat.sysstr(str(numcpus))) + + workers_enabled = self._ui.configbool("worker", "enabled", True) + if not workers_enabled: + os.environ["RAYON_NUM_THREADS"] = pycompat.sysstr("1") + ( lookup, modified,