Skip to content
Snippets Groups Projects
Commit 69ed2cff authored by Gregory Szorc's avatar Gregory Szorc
Browse files

worker: rename variable to reflect constant

Differential Revision: https://phab.mercurial-scm.org/D3961
parent 9e6afe7f
No related branches found
No related tags found
No related merge requests found
......@@ -62,5 +62,5 @@
return min(max(countcpus(), 4), 32)
if pycompat.isposix or pycompat.iswindows:
_startupcost = 0.01
_STARTUP_COST = 0.01
else:
......@@ -66,8 +66,8 @@
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)
......@@ -68,10 +68,10 @@
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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment