* 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
()
| 235 | * load, ~hundreds of ms, and growth only triggers as queue pressure builds). |
| 236 | */ |
| 237 | prewarm(): void { |
| 238 | while (this.workers.size < this.maxSize) { |
| 239 | const before = this.workers.size; |
| 240 | this.spawnOne(); |
| 241 | if (this.workers.size === before) break; // spawn failed / breaker tripped |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | /** Pool size cap (for logging). */ |
| 246 | get size(): number { return this.maxSize; } |