* Spawn the whole pool up front. The default demand-driven growth avoids * paying worker boot for small jobs, but a bulk index KNOWS every core will * be needed — on a fast repo the one-by-one ramp-up otherwise consumes most * of the parse phase (each worker boot is a fresh Node isolate + g
()
| 216 | * load, ~hundreds of ms, and growth only triggers as queue pressure builds). |
| 217 | */ |
| 218 | prewarm(): void { |
| 219 | while (this.workers.size < this.maxSize) { |
| 220 | const before = this.workers.size; |
| 221 | this.spawnOne(); |
| 222 | if (this.workers.size === before) break; // spawn failed / breaker tripped |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | /** Pool size cap (for logging). */ |
| 227 | get size(): number { return this.maxSize; } |