Skip to content

Replacing entire "state" on client from server refresh #74

Answered by Pauan
yatesco asked this question in Q&A
Discussion options

You must be logged in to vote

For lists you generally want to use MutableVec instead of Mutable, because MutableVec is much faster (updates are O(1) instead of O(n)).

The reason for this is because MutableVec processes the differences between changes, not the entire list. So because it's only processing the differences, it's much much much faster.

For more context, the updates we get from the server are very coarse - literally, the entire state, regardless of what has changed, so if a new Widget is added then we receive the entire state over, and over (and over).

Ideally the server would send more fine-grained updates, it's most efficient to fix the problem at the source instead of working around it in the client.

B…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@yatesco
Comment options

Answer selected by yatesco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants