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

fix performance createListenerCollection #1450

Merged
merged 4 commits into from
Nov 6, 2019

Conversation

leshkovichpvl
Copy link
Contributor

@leshkovichpvl leshkovichpvl commented Nov 6, 2019

createListenerCollection has a bad performance for more listeners.
In my implementation, performance is much better

before:
Screen Shot 2019-11-06 at 18 13 44

after:
Screen Shot 2019-11-06 at 18 18 26

@netlify
Copy link

netlify bot commented Nov 6, 2019

Deploy preview for react-redux-docs ready!

Built with commit 58a4b27

https://deploy-preview-1450--react-redux-docs.netlify.com

@timdorr
Copy link
Member

timdorr commented Nov 6, 2019

Can you provide some numbers on how this performs better?

@leshkovichpvl
Copy link
Contributor Author

leshkovichpvl commented Nov 6, 2019

Can you provide some numbers on how this performs better?

I added screenshots to make it clear.

@timdorr
Copy link
Member

timdorr commented Nov 6, 2019

OK, I cleaned things up a bit.

We used the previous current/next form copied from Redux core because we wanted to ensure adding a subscriber while dispatching wouldn't trigger an edge case. However, since this code is nested inside of Subscription anyways, we actually don't need these guarantees.

Thanks for the PR!

@timdorr timdorr merged commit 476c0de into reduxjs:master Nov 6, 2019
@leshkovichpvl
Copy link
Contributor Author

I'm sorry, I made a mistake. This PR must be revert. Because it led to the wrong order of calling parent/child selectors.😟

leshkovichpvl added a commit to leshkovichpvl/react-redux that referenced this pull request Nov 7, 2019
timdorr pushed a commit that referenced this pull request Nov 7, 2019
albertodev7 pushed a commit to albertodev7/react-redux that referenced this pull request Dec 8, 2022
* fix performance createListenerCollection

* fix get for test

* small fix

* Simplify, pretty up, and remove vars
albertodev7 pushed a commit to albertodev7/react-redux that referenced this pull request Dec 8, 2022
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

Successfully merging this pull request may close these issues.

2 participants