-
Notifications
You must be signed in to change notification settings - Fork 1
Redux is spammed with BACKEND_CONNECTION_UP
actions
#411
Comments
There also seems to be some kind of correctness problem with the triggering of Given the timing of this flood of actions, it seems plausible to me that this could be making the frontend's CPU usage measurably higher than it's supposed to be, so we should definitely measure CPU usage before and after this is fixed. This flooding problem should be fixed before we suppress |
(tested on d71f11a with backend running simulator)
so the code in so I think we should probably return early if the backend is connected? wouldn't that solve both the issues? |
But what you describe is only a subset of the behavior I see: when the backend is connected,
I expect this could solve the problem in the main description of this issue (to quote, "only dispatch the Perhaps one thing we could do to make the
I looked a bit more closely at the
|
@ethanjli It looks like the so I feel we have two options:
one thing is |
Oh, this is very interesting. It sounds like this |
oh great, I think we can do that! I'll keep |
Right now the
HeartbeatBackendListener
component inOverlayScreen.tsx
dispatches anestablishedBackendConnection
action on every single message the frontend receives from the backend. With the current messaging settings, that means that the frontend is usually having to process an extra (redundant) action up to once every 10 ms. This is probably not the main performance bottleneck in our frontend, but it adds a ton of extra events into the Redux inspector (which makes it harder to catch other actions). The fix should be relatively straightforward to implement: only dispatch theestablishedBackendConnection
action if the backend is not already connected (as reported by thegetBackendConnected
selector).It might be worth getting CPU usage measurements before and after this is fixed, just to get a sense of whether this issue has any measurable impact on CPU usage.
The text was updated successfully, but these errors were encountered: