D3961: worker: rename variable to reflect constant

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Wed Jul 18 00:43:39 UTC 2018


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/worker.py

CHANGE DETAILS

diff --git a/mercurial/worker.py b/mercurial/worker.py
--- a/mercurial/worker.py
+++ b/mercurial/worker.py
@@ -56,16 +56,16 @@
     return min(max(countcpus(), 4), 32)
 
 if pycompat.isposix or pycompat.iswindows:
-    _startupcost = 0.01
+    _STARTUP_COST = 0.01
 else:
-    _startupcost = 1e30
+    _STARTUP_COST = 1e30
 
 def worthwhile(ui, costperop, nops):
     '''try to determine whether the benefit of multiple processes can
     outweigh the cost of starting them'''
     linear = costperop * nops
     workers = _numworkers(ui)
-    benefit = linear - (_startupcost * workers + linear / workers)
+    benefit = linear - (_STARTUP_COST * workers + linear / workers)
     return benefit >= 0.15
 
 def worker(ui, costperarg, func, staticargs, args):



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


More information about the Mercurial-devel mailing list