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
Usage with redux router spikes CPU to 100% #23
Comments
Looking into it, I profiled the page and it appears there's one function that seems to be the bottleneck: which looks like it's coming from here https://github.com/zalmoxisus/redux-devtools-extension/blob/1d177edf39eaf6d00dc96a58269cfdc03252780b/src/browser/extension/inject/pageScript.js |
I haven't been able to show a proof of work, the code I have is pretty customized now |
Thanks for detailed info. That code is from json-stringify-safe. Though it is not the problem, but just the consequence, you can try to disable the serialization, as described here, and see if the extension works. Also there in the Options page, you may add a bigger delay so it will do the serialization and message posting not so often. The problem is that you got somehow an endless number of changes in the Devtools store (liftedStore), and we still don't know the cause. If you could help me to reproduce it, I'd can help with solving it. It would be great if you'd try to run my boilerplate, it contains redux router and hmr as well, just versions of some modules may be different. If it is possible to add some modifications to it to reproduce the issue. |
Hey @kolodny, Still wasn't able to replicate this issue, but I added the ability to filter actions in |
Nice, I'm gonna try to start binary adding my components to the boilerplate
|
I hope the issue was related to Please let me know if it still occurs. There's a similar issue with persistStore (even in the regular Redux DevTools). If we manage to solve this one, the latter could be solved as well. |
I'm seeing a huge CPU spike on page load in my app. I haven't really had On Thu, Dec 17, 2015 at 10:22 AM, Mihail Diordiev notifications@github.com
|
Thank you @kolodny for your reports, it was helpful a lot. It seems to me that there are no related bugs caused by I added an example with Redux Router, where we generate consecutive actions ("AutoTodo") in order to simulate high activity. So, yes, with more than 2000 tasks in todo I see serialization being a huge bottleneck: A temporary solution would be to increase the delay (as described here). With a delay of 10 seconds, even with a huge state object it works smoothly: I'll try to find a way to relay only changes not the whole lifted store, I guess I'll had to rewrite the Redux Devtools implementation. |
I heard Redux Router puts components into state so this may be the problem. |
@gaearon, yes, By the way, there's the same problem as here with |
…with history tree Related to #23.
Now (in When you have some time to test it, please let me know whether it works well for you now. If still something goes wrong, feel free to reopen the issue. |
Just checked, it seems to work great now, Thanks! |
btw I wrote a library for serializing and deserializing json that can have circular refs and is pretty performant, not sure if it matters anymore tho https://github.com/kolodny/jsan |
Of course it matters, there's always space for optimisations. The library is awesome! As states shouldn't be mutated, we will not have non-circular self references inside. Am I right, @kolodny? Could we rely on the default |
If the only types of references you will have are circular then jsan is what you're looking for. That's the exact use case that it really shines and here why: The basic way it works is that there are two ways to call The regular way which is as fast as On the parse side, if the inputted string contains a special marker, which will only be there if it used the traversal method on A lot of work has gone into getting every last bit of performance, things like avoiding |
Thanks a lot for the detailed explanation! Will use it here and for |
👍 |
I've narrowed my issue down to this triggering it:
The text was updated successfully, but these errors were encountered: