-
Notifications
You must be signed in to change notification settings - Fork 998
Open
Labels
Description
Proposal: Optimize DataModel Notification Strategy
Reason
The current DataModel.notifySignals implementation performs a linear scan of all registered signals to find descendants whenever a value is updated. This becomes a performance bottleneck as the number of reactive bindings grows.
Design
-
Trie Structure: Replace the flat
Map<string, Signal>for signals with a Trie (Prefix Tree). -
Efficient Lookup: When a path like
/useris updated:- Bubble: Traverse up the tree to notify ancestors.
-
Cascade: Visit the subtree at
userto notify all descendants.
-
Complexity: This reduces notification overhead from
$O(N)$ (where$N$ is total signals) to$O(P + D)$ (where$P$ is path depth and$D$ is the number of actual descendants).
Key Files
renderers/web_core/src/v0_9/state/data-model.ts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo