Summary
DataFlowAnalyzer._collect_nodes uses a Python list queue with pop(0), which is O(n) per pop. On large CFGs this turns node collection into avoidable O(n^2) behavior.
Suggested direction
- Replace list queue with
collections.deque and popleft().
- Keep traversal behavior identical (reachable nodes only, deterministic ordering after final sort).
Acceptance
- Same node set and order semantics as before.
- Reduced collection time in synthetic large-CFG benchmark.
Code
refactron/analysis/data_flow.py — _collect_nodes
Summary
DataFlowAnalyzer._collect_nodesuses a Python list queue withpop(0), which is O(n) per pop. On large CFGs this turns node collection into avoidable O(n^2) behavior.Suggested direction
collections.dequeandpopleft().Acceptance
Code
refactron/analysis/data_flow.py—_collect_nodes