You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've had several folks report that rendering a long list of components with RTKQ hooks can be very slow. My suspicion is that it's because we dispatch separate "need to subscribe" actions for every component. The first component will fetch the data and create the cache entry. All other components will see the cache entry exists, dispatch a rejected action, and the subscription logic handles that to add another subscription.
Additionally, as components unsubscribe, there's a lot of timer cancelation and resetting going on.
I think we need to figure out how to batch the "cache entry exists but need to subscribe" behavior into some debounced batched actions to cut down on the overhead. We may also need to tweak the unsubscribe handling as well to cut down on timer manipulation.
Don't have a performance capture atm - I should set up an example.