Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

progressively compute view value #28

Open
pgte opened this issue Dec 2, 2018 · 1 comment
Open

progressively compute view value #28

pgte opened this issue Dec 2, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@pgte
Copy link
Collaborator

pgte commented Dec 2, 2018

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

@pgte pgte added the enhancement New feature or request label Dec 2, 2018
@pgte pgte self-assigned this Dec 4, 2018
@pgte
Copy link
Collaborator Author

pgte commented Dec 8, 2018

Done in type "RGA" by #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant