MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / prewarm

Method prewarm

src/extraction/parse-pool.ts:278–284  ·  view source on GitHub ↗

* 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

()

Source from the content-addressed store, hash-verified

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 {

Callers 2

indexAllMethod · 0.80
parse-pool.test.tsFile · 0.80

Calls 2

wantedSizeMethod · 0.95
spawnOneMethod · 0.95

Tested by

no test coverage detected