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
{{ message }}
Repository navigation
perf(sdui): cache visible row list and eliminate rows.any linear scan in SduiTreeBuilder.build() #1359
In lib/features/connections/sdui_tree_builder.dart:
Uncached tree traversal on every build:
In build() (lines 188–189): final rows = _flattenVisible();
Every time SduiTreeBuilder rebuilds (e.g. on row hover, selection change, scroll, or parent rebuild), _flattenVisible() walks the entire expanded tree and allocates a new List<_VisibleRow> with individual _VisibleRow.node objects for every visible node.
Linear rows.any scan:
In line 194: itemExtent: rows.any((r) => r.isError) ? null : _rowExtent,
It runs rows.any(...), which traverses the entire flattened row list on every build. Meanwhile, _expandErrors is a Map<String, String> tracked in state, so checking _expandErrors.isNotEmpty is an (1)$ check that completely eliminates this list scan.
Proposed Solution
Cache _visibleRows in state and only recompute when tree roots, expanded set, or load errors change.
Replace rows.any((r) => r.isError) with _expandErrors.isNotEmpty.
Acceptance Criteria
Hovering over tree rows or updating selection does not re-walk the tree hierarchy or re-allocate visible rows.
Activity
ZhuchkaTriplesix commentedon Oct 11, 2026
Done in #1405 (merged into
dev).