Patchwork D3961: worker: rename variable to reflect constant

login
register
mail settings
Submitter phabricator
Date July 19, 2018, 12:18 p.m.
Message ID <c6bd1fb3fc4e9e1183710c440d624aa6@localhost.localdomain>
Download mbox | patch
Permalink /patch/32911/
State Not Applicable
Headers show

Comments

phabricator - July 19, 2018, 12:18 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG69ed2cff4277: worker: rename variable to reflect constant (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3961?vs=9619&id=9629

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

AFFECTED FILES
  mercurial/worker.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/worker.py b/mercurial/worker.py
--- a/mercurial/worker.py
+++ b/mercurial/worker.py
@@ -62,16 +62,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):