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
Currently, the view value (Type.value(state)) is re-computed every time, and this has at least a O(n) complexity.
An application typically listens to state changed events and then calls .value(state), which is expensive to do every time there is a mutation.
Proposed solution
Instead of computing the state every time .value() is called, keep the value around and, on each delta applied, change the value accordingly.
This will most probably require some changes to the API, or some new API that makes it stateful and where a specific type can interpret the deltas, generate specific mutation events, and apply them to the view value.
Current state
Currently, the view value (
Type.value(state)
) is re-computed every time, and this has at least a O(n) complexity.An application typically listens to state changed events and then calls
.value(state)
, which is expensive to do every time there is a mutation.Proposed solution
Instead of computing the state every time
.value()
is called, keep the value around and, on each delta applied, change the value accordingly.This will most probably require some changes to the API, or some new API that makes it stateful and where a specific type can interpret the deltas, generate specific mutation events, and apply them to the view value.
/cc @satazor @jimpick
The text was updated successfully, but these errors were encountered: