redux-requests icon indicating copy to clipboard operation
redux-requests copied to clipboard

rewrite some normalisation functions from recursive function to function with loops

Open klis87 opened this issue 4 years ago • 3 comments

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

klis87 avatar Mar 22 '20 16:03 klis87

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

favger avatar Jan 17 '21 14:01 favger

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 avatar Jan 17 '21 14:01 klis87

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

klis87 avatar Jan 17 '21 15:01 klis87