Commit 372a15e
Never schedule fewer workers than the file count already justifies
sqrt(files) dips below the existing job-count formula between roughly 400 and
800 files, so the rule quietly took workers away from large runs. On 600 warm
files it scheduled 12 where the default schedules 14, and measured 13.2% slower
against a 2.2% control.
The rule exists to stop small runs being starved, never to reduce a large one.
Take the maximum of the two, so the adaptive count can only ever raise
parallelism. Small runs are unchanged: 9, 25, 50, 100 and 200 files still
schedule 2, 3, 4, 5 and 7 workers.
The test asserts the invariant across 13 file counts rather than trusting a
table, because the dip only shows up in a band neither end of the range covers.
Reported by @staabm on the pull request.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent b45102f commit 372a15e
2 files changed
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
146 | 151 | | |
147 | 152 | | |
148 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
234 | 253 | | |
235 | 254 | | |
236 | 255 | | |
| |||
0 commit comments