You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: use Map for invocationsQueue (O(1) lookup/delete)
Replace array-based invocationsQueue with Map<string, QueueItem> for
O(1) lookup and delete operations. This eliminates the O(n²) complexity
from findIndex + splice patterns in step.ts, hook.ts, and sleep.ts.
Changes:
- private.ts: Change invocationsQueue type from QueueItem[] to Map
- workflow.ts: Initialize with new Map() instead of []
- global.ts: Accept Map or array in WorkflowSuspension, add single-pass counting
- step.ts: Use Map.set/has/delete instead of push/findIndex/splice
- hook.ts: Use Map.set/delete instead of push/findIndex/splice
- sleep.ts: Use Map.set/get/delete instead of push/find/findIndex/splice
This is Phase 1 of the high-concurrency workflow optimization plan.
See beads issue wrk-fyx for details.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
0 commit comments