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

rewrite some normalisation functions from recursive function to function with loops #317

Open
klis87 opened this issue Mar 22, 2020 · 3 comments

Comments

@klis87
Copy link
Owner

klis87 commented Mar 22, 2020

Most things in https://github.com/klis87/redux-saga-requests/tree/master/packages/redux-saga-requests/src/normalizers is implemented as recursive functions.

It is surprisingly fast currently, especially with selectors, but I think it would be nice to refactor it into loops, it would faster for sure and we wouldnt risk stack overflow error

Because recursive functions are easier to understand, I think it is also worth it to leave current implementation as legacy code for reference

@favger
Copy link

favger commented Jan 17, 2021

Yes, we cannot use normalization for this reason 😢 (performance problem)

@klis87
Copy link
Owner Author

klis87 commented Jan 17, 2021

Performance problem or maximum stack error? Any case, it would be very useful if you could provide a reproduction of performance issues, you can use https://github.com/klis87/redux-requests/tree/master/examples/showcase as a start, as there you could easily mock some endpoints on the server, as well as it is client side only (no ssr), you could get rid of material ui, can be black and white, just wanna see performance issues

If this is indeed issues with recursiveness, this is a must have to fix

@klis87
Copy link
Owner Author

klis87 commented Jan 17, 2021

btw, also pls hint me what is problem with performance, initial render, updates?

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

2 participants