OpenImaging / miqa-phase1

A web application for medical imaging quality assurance
MIT License
20 stars 8 forks source link

Remove heaviest objects from state #47

Closed scottwittenburg closed 3 years ago

scottwittenburg commented 3 years ago

We had a suggestion that application performance could be affected by keeping large/complex objects in the vuex state. Since we do notice some degradation of performance over time interacting with the app (#44), I have made this attempt to move all the heavy stuff out of the state (except for the experiementIds, a list which seems to be needed to maintain reactivity) and into module-level variables.

It was difficult to determine whether this had an effect on performance or not, but it could be that the unbounded listener growth issue (#43) obscured the difference.

I think this will make it a little easierto update the store so that it uses mutations exclusively to update the state, which is another thing I'd like to tackle soon.

scottwittenburg commented 3 years ago

I thought this was working fine, but discovered a bug that happened on import, and it led me to think my approach for moving objects out of the state was not correct. The problem seemed was focused in the SessionsView component which needs all the heavy objects I moved. Perhaps implementing mutations for the heavy objects and then invoking those from the loadSessions method could have helped?

We can revisit the idea again later.