Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/discovery load time spike #1579

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

jarvisraymond-uchicago
Copy link
Contributor

@jarvisraymond-uchicago jarvisraymond-uchicago commented Aug 9, 2024

Spike for Improve Discovery Page Loading UX

Ticket: https://ctds-planx.atlassian.net/browse/HP-1643

Before
Load time is approximately 5 seconds. Searches entered during loading do not update once loading is completed.
output

After
UX proposed with batch loading of 10 studies and then the rest. Initial load of first 10 studies takes around 200-300ms (95% improvement). UX shown includes a mini progress bar.

  • Searches entered during loading update with all available results after loading is completed.
  • Filters and Data Repository selection is disabled until loading is completed.

output

Instructions:
Pull local, then run in QA Dev.

Mini Progress Bar by Studies Count:
https://qa-heal.planx-pla.net/portal/dev.html?showMini

// to improve load time & usability
// Initially uses a smaller batch to load interface quickly
// Then a batch with all the studies
const [studiesBatchCount, setStudiesBatchCount] = useState(0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Update the variable name to "numberOfBatchesLoaded"

@@ -167,16 +202,27 @@ const DiscoveryWithMDSBackend: React.FC<{

// indicate discovery tag is active even if we didn't click a button to get here
props.onDiscoveryPageActive();
}, []);
}, [props, studiesBatchCount]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Update the variable name to "numberOfBatchesLoaded"

useEffect(() => {
// If batch loading is Enabled, update the studiesBatchCount to enable calling of different batch sizes
// with different parameters
if (studiesBatchCount < expectedNumberOfTotalBatches) setStudiesBatchCount(studiesBatchCount + 1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Update the variable name to "numberOfBatchesLoaded"

Copy link

Please find the ci env pod logs here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant