##// END OF EJS Templates
worker: rename variable to reflect constant...
Gregory Szorc -
r38753:69ed2cff default
parent child Browse files
Show More
@@ -62,16 +62,16 b' def _numworkers(ui):'
62 return min(max(countcpus(), 4), 32)
62 return min(max(countcpus(), 4), 32)
63
63
64 if pycompat.isposix or pycompat.iswindows:
64 if pycompat.isposix or pycompat.iswindows:
65 _startupcost = 0.01
65 _STARTUP_COST = 0.01
66 else:
66 else:
67 _startupcost = 1e30
67 _STARTUP_COST = 1e30
68
68
69 def worthwhile(ui, costperop, nops):
69 def worthwhile(ui, costperop, nops):
70 '''try to determine whether the benefit of multiple processes can
70 '''try to determine whether the benefit of multiple processes can
71 outweigh the cost of starting them'''
71 outweigh the cost of starting them'''
72 linear = costperop * nops
72 linear = costperop * nops
73 workers = _numworkers(ui)
73 workers = _numworkers(ui)
74 benefit = linear - (_startupcost * workers + linear / workers)
74 benefit = linear - (_STARTUP_COST * workers + linear / workers)
75 return benefit >= 0.15
75 return benefit >= 0.15
76
76
77 def worker(ui, costperarg, func, staticargs, args):
77 def worker(ui, costperarg, func, staticargs, args):
General Comments 0
You need to be logged in to leave comments. Login now