* 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
()
| 301 | * pressure builds). |
| 302 | */ |
| 303 | prewarm(): void { |
| 304 | while (this.workers.size < this.wantedSize()) { |
| 305 | const before = this.workers.size; |
| 306 | this.spawnOne(); |
| 307 | if (this.workers.size === before) break; // spawn failed / breaker tripped |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | /** The workers the parsing still to come is worth. */ |
| 312 | private wantedSize(): number { |
no test coverage detected