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