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

Comparison with React-Redux v5 beta? #1

Open
markerikson opened this issue Sep 14, 2016 · 6 comments
Open

Comparison with React-Redux v5 beta? #1

markerikson opened this issue Sep 14, 2016 · 6 comments

Comments

@markerikson
Copy link
Contributor

FYI, there's a beta version of React-Redux that is a complete internal rewrite, using layered memoized selectors internally to minimize updates. Any thoughts on how your approach compares?

See reduxjs/react-redux#416 for details.

@l2silver
Copy link
Owner

Yeah, I would say that the rewrite looks like incremental changes. Basically, more attempts to make sure that memoizers are not retriggering needlessly. Useful stuff, but still suffering from the same fundamental problem... Vanilla connect needs to update everytime the store changes, because it does not know if there are children connect components that need to update. Blackbox compiles all of the stateProps at the provider level and knows when it gets to a blackbox connect component whether or not the component should update or not.

but there are tradeoffs too. With blackbox you need to worry about double calculations.

I wrote a little article about this here.
https://medium.com/@l.silversteinto/react-redux-blackbox-a94141ed00c7#.z4mkdmb1r

Also, if you don't mind my asking, how did you find this repository?

@markerikson
Copy link
Contributor Author

Also, if you don't mind my asking, how did you find this repository?

I have a standing Github search for "Redux" sorted by "most recently updated" . I browse through the search results on a regular basis to see what sort of new and interesting repos are out there.

I skimmed the article and this repo earlier to get a general idea what it's doing. Am I correct that the basic intent is to change N store subscriptions into 1 subscription? Are there any specific performance benchmarks that show this is an improvement over either the existing React-Redux v4 or the upcoming v5? Are there specific performance issues you've run into in the past that led to you working on this?

@l2silver
Copy link
Owner

Ah thanks. I was still planning on doing a little more work before showing this around.

The basic gist of it is 1 subscription. There's no particular performance issues I was looking to solve. I just didn't like that the connect components had to update everytime the store changed. I haven't run any benchmark tests yet, but I might run some tonight. Are there any standard repos that we use for benchmarking read-redux?

@markerikson
Copy link
Contributor Author

Yeah, see that issue 416 for some perf benchmarks and examples, as well as reduxjs/react-redux#407 (comment) .

@l2silver
Copy link
Owner

Thanks, I'll take a look.

@l2silver
Copy link
Owner

So I took a look last night, and the results were...

Exactly the same as vanilla react-redux. lol.

I'm going to try a few tweaks, but I can see going through the benchmarks that react-redux is able to handle a lot of situations I didn't think it could handle. Its solutions aren't functional, but neither is react, so everything works pretty well.

I have one more thing to check, and that's how expensive it is for react to handle multiple setStates. If there's no extra expense, then I'll probably hangup blackbox.

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

No branches or pull requests

2 participants