SCIInstitute / shapeworks-cloud

A web version of ShapeWorks Studio
https://www.shapeworks-cloud.org/#/
Apache License 2.0
1 stars 0 forks source link

Improve data loading strategy upon selecting a project #376

Open annehaley opened 4 months ago

annehaley commented 4 months ago

When a project is selected and the main UI is loaded, a lot of requests are sent to load all subjects for a dataset, all original data objects for each subject, groomed shapes for all original data, all particles objects, etc. The time to load all of these objects was negligible on smaller test datasets, but now that we've tested larger datasets with over 40 subjects, this load time reduces interactibility of the other UI components. Even if the data to render is ready and the load bar has gone away, the high traffic from all the other requests stalls reactivity in the Info Tab (loading landmarks and constraints) and the Analyze and DeepSSM tabs (loading results).

We should improve the data loading strategy by taking a lazy-load approach, only making data requests when they are needed. The initial data load upon selecting a dataset should only include the list of subjects, the first original data object to render by default, and test requests for one groomed shape, one particles object, and one reconstructed sample to determine whether those layers should be available for the user to enable. The rest of the data should only be fetched when needed for rendering or displaying results.