Fix delegate dedup path scoping #567
+68
−9
Merged
probelabs / Visor: performance
succeeded
May 21, 2026 in 1m 24s
✅ Check Passed (Warnings Found)
performance check passed. Found 1 warning, but fail_if condition was not met.
Details
📊 Summary
- Total Issues: 1
- Warning Issues: 1
🔍 Failure Condition Results
Passed Conditions
- global_fail_if: Condition passed
Issues by Category
Performance (1)
⚠️ npm/src/tools/vercel.js:722 - The newsamePathDelegationsfilter creates a new array on every delegate search by iterating through the entirepreviousDelegationsarray. This is O(n) per delegation, which becomes inefficient as the session grows with many delegations across different paths. For long-running sessions with hundreds of delegations, this repeated filtering could cause measurable performance degradation.
Powered by Visor from Probelabs
💡 TIP: You can chat with Visor using /visor ask <your question>
Annotations
Check warning on line 722 in npm/src/tools/vercel.js
probelabs / Visor: performance
performance Issue
The new `samePathDelegations` filter creates a new array on every delegate search by iterating through the entire `previousDelegations` array. This is O(n) per delegation, which becomes inefficient as the session grows with many delegations across different paths. For long-running sessions with hundreds of delegations, this repeated filtering could cause measurable performance degradation.
Raw output
Consider maintaining a Map or object indexed by path for O(1) lookups instead of O(n) filtering. For example: `const delegationsByPath = new Map(); delegationsByPath.set(delegatePath, delegationsByPath.get(delegatePath) || []);` This would eliminate the linear scan on every delegation.
Loading