ruvnet/ruflo · error
Worker spawn exceeded 50ms target: ${spawnTime.toFixed(2)}ms
Error message
Worker spawn exceeded 50ms target: ${spawnTime.toFixed(2)}ms What it means
Performance warning in WorkerDispatch.dispatch(): spawning and queueing a worker took longer than the 50ms latency target measured via performance.now(). Functionally successful; flags regression in spawn-path performance.
Source
Thrown at v3/@claude-flow/swarm/src/workers/worker-dispatch.ts:408
this.workers.set(workerId, worker);
// Add to queue with priority
const priority = this.getPriorityValue(options.priority || TRIGGER_CONFIGS[trigger].priority);
this.queue.push({ id: workerId, priority });
if (this.config.priorityQueue) {
this.queue.sort((a, b) => b.priority - a.priority);
}
// Emit event
this.emit('worker:queued', { workerId, trigger, context });
// Process queue
await this.processQueue();
const spawnTime = performance.now() - startTime;
if (spawnTime > 50) {
console.warn(`Worker spawn exceeded 50ms target: ${spawnTime.toFixed(2)}ms`);
}
return workerId;
}
/**
* Detect triggers in a prompt/context
*
* @param text - Text to analyze
* @returns Detection result
*/
detectTriggers(text: string): TriggerDetectionResult {
const startTime = performance.now();
const detectedTriggers: WorkerTrigger[] = [];
let totalMatches = 0;
for (const [trigger, patterns] of Object.entries(TRIGGER_PATTERNS) as [WorkerTrigger, RegExp[]][]) {
for (const pattern of patterns) {View on GitHub (pinned to fa13ee4ad6)
Solutions
- Reduce per-spawn initialization work (lazy-load modules, reuse worker pools) to bring spawn time under the 50ms target.
- Pre-warm worker threads/processes at startup so dispatch does not pay cold-start cost.
- Profile the spawn path to find the slow step (module load, IPC setup, serialization) and optimize it.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Worker thread spawn latency exceeds the 50ms performance budget; occurs under CPU contention, cold V8 isolate startup, large bundled worker entry scripts, or when the host process is near its thread/file-descriptor limits.
Common situations: See trigger scenarios.
AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18).
Data as JSON: /api/errors/24046904e48081f7.
Report an issue: GitHub.