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

need to make sure state updates only affect correct components #1719

Closed
bcolloran opened this issue Apr 8, 2019 · 1 comment
Closed

need to make sure state updates only affect correct components #1719

bcolloran opened this issue Apr 8, 2019 · 1 comment

Comments

@bcolloran
Copy link
Contributor

in React DevTools, if you enable "highlight updates" and take just any notebook action, you'll see that virtually every component in the notebook rerenders (see https://reactjs.org/docs/optimizing-performance.html#avoid-reconciliation and https://blog.logrocket.com/make-react-fast-again-part-3-highlighting-component-updates-6119e45e6833 for the React DevTools feature)

(importantly, react devtools only connects to the top level of a page, but not iframes :-/ . to work around that, we may need something like this: https://github.com/eddyerburgh/react-dev-tools-iframe-webpack-plugin . I suspect that all the little components in the console are re-rendering at every state update, which adds up to kill perf once a lot of them are present)

I believe that this heap of needless re-renders kill our perf, especially in when evaling a bunch of chunks quickly (e.g. via run all).

leading recommended techniques for fixing this include using reselect to memoize props in mapStateToProps, but there is a ton of other good stuff here:

@bcolloran
Copy link
Contributor Author

turns out that React DevTools gives false positives with react-redux facebook/react-devtools#1290
grrrr

hopefully this will be fixed someday. in the meantime, you can't really use the react devtools for perf profiling our app, which is sad :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant