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
Use shallowEqual from fbjs #591
Conversation
We should perf test this, since it's called so much. It's useful to remember that we're not comparing any 2 rando values, but specifically props objects coming from react. I think we can make certain assumptions, like that they're objects, and typically (99% of time?) that the # of props is going to be the same between the 2 args. So the algorithm can optimize for things like that. |
True, but I think the effects are minor. Given this is a hot path, it's going to get optimized pretty heavily. I think the only thing to do is to use the for in loop form instead, as v8 has specific optimizations for that with a |
If the perf of the fbjs version is fine, then maybe we should just import it from fbjs. fbjs is a dependency of react, so react-redux has a dependency on it indirectly already. |
AFAIK, |
Works for me. This should be fast enough for normal usage. And if someone really needs a faster implementation than the fbjs, they have the power to override it in the options. |
I wouldn't recommend depending on anything from |
(Copying is fine 😄 ) |
This seems like it happens often; |
Fixes #590
Also handles things like NaN.