-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Vuex recording performance improvements #546
Comments
I was also thinking of splitting this snapshot work per modules. That way, we only send module state that changed instead of all the modules every time. Also, we are currently sending the snapshot for each mutation. We could only send it if the Vuex tab is active. |
We could only send an index there. Then we replay the mutations up to this index and we can cache it to speed up things for next time. |
Do you think it's possible this could be causing the devtools to crash for me every once in a while after prolonged use? I have a large dataset loaded up (~20,000 objects) for a cordova web application. I am using I've noticed after a number of mutations or webpack reloads it'll crash. |
@mcfarljw if all that state is stored in Vuex, then it's likely. Try turn off Vuex recording when you don't need it. |
@yyx990803 is there a programmatic way how to disable it when the app loads? I'd like to disable events and mutations recording by default for my app. |
There is clearly a performance problem introduced by copying massive object structures on every mutation, so the main goal would be to get rid of that (at least not do it every frame). Instead of doing full state snapshots every time, maybe the actual mutated state could be tracked using vue’s reactivity. Extension would then only receive new values of changed fields directly. The full state snapshot could be rebuilt from partial updates in the extension thread, which leaves app responsive and debuggable. Other potential benefit from that would be the ease of implementation of "diff" feature (similar to redux devtools). The incremental mutation changes could be displayed directly to the user. That “diff” view would have a benefit of preserving the intent of a programmer exactly, instead of relying on heuristics to make sensible representation of difference between two big objects. |
Currently the Vuex panel takes a JSON snapshot of the entire store on every mutation, and this can lead to perf problems when the store state is large, or when there are many mutations being committed with short intervals.
Instead of the taking a full snapshot every time, we can:
This means inspected state snapshots are resolved on demand, and each mutation only sends a payload of the mutation itself, which should be drastically cheaper.
The text was updated successfully, but these errors were encountered: