* Spawn the pool up front, as far as the run is worth it. The default * demand-driven growth avoids paying worker boot for small jobs, but a bulk * index knows how much work is coming — on a fast repo the one-by-one ramp-up * otherwise consumes most of the parse phase (each worker boot is a
()
| 276 | * pressure builds). |
| 277 | */ |
| 278 | prewarm(): void { |
| 279 | while (this.workers.size < this.wantedSize()) { |
| 280 | const before = this.workers.size; |
| 281 | this.spawnOne(); |
| 282 | if (this.workers.size === before) break; // spawn failed / breaker tripped |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | /** The workers the parsing still to come is worth. */ |
| 287 | private wantedSize(): number { |
no test coverage detected