perf(#314): index roadmap plan lookups by id (O(lines×plans) → O(lines+plans)) (#396)

Hot path in cmdRoadmapAnnotateDependencies called planData.find() on every
checklist line. Replaced with a first-wins Map built once before the loop so
each line resolves in O(1); first-wins preserves exact .find() semantics and
null-on-miss → wave-1 default is unchanged.

Fixes #314

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-05-27 20:21:46 -04:00
committed by GitHub
parent 8c8887f00e
commit 4361d83279
3 changed files with 54 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
type: Fixed
pr: 314
---
`roadmap annotate-dependencies` now indexes plan data by ID in a Map before the checklist loop, reducing plan lookup from O(lines×plans) to O(lines+plans).