pez-globo / pufferfish-software

All software for the Pufferfish ventilator.
Apache License 2.0
0 stars 1 forks source link

The frontend's dashboard has too many spurious redraws #404

Closed ethanjli closed 3 years ago

ethanjli commented 3 years ago

When I open the frontend in Google Chrome and set the Preact Developer Tools extension to highlight all component redraws, I see that all the LargeValueInfo components are constantly being redrawn, even when the data hasn't changed. This is because of the way we implemented the HFNC dashboard layout as returning a bunch of LargeValueInfo components, rather than returning containers (i.e. LargeValueInfo components which were connected to selectors using react-redux's connect). I'm not sure this is the main reason the frontend uses so much single-core CPU on the RPi (often above 100%), but in the past we found that this was definitely a major contributing factor in wasting CPU. We need to fix this.