l2silver / react-redux-blackbox

Unofficial react to redux bindings
MIT License
0 stars 0 forks source link

Comparison with React-Redux v5 beta? #1

Open markerikson opened 8 years ago

markerikson commented 8 years ago

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 https://github.com/reactjs/react-redux/pull/416 for details.

l2silver commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

Yeah, see that issue 416 for some perf benchmarks and examples, as well as https://github.com/reactjs/react-redux/issues/407#issuecomment-226895455 .

l2silver commented 8 years ago

Thanks, I'll take a look.

l2silver commented 8 years ago

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.