Skip to content

perf(orchestration): cache forward adjacency in CascadeDetector::descendant_count to avoid per-tick rebuild #3094

@bug-ops

Description

@bug-ops

descendant_count() rebuilds a forward-adjacency HashMap from scratch on every call. deprioritized_tasks() calls this once per tick per task when cascade routing is enabled. For K roots × N tasks this is O(K*(N+E)) per tick. Fix: cache the forward adjacency in CascadeDetector and invalidate on reset().

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexityperformancePerformance improvements

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions