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

Improve resources page performance with many resources #2556

Merged
merged 3 commits into from
Mar 5, 2024

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Mar 1, 2024

The dashboard resource's page subscribes to resource updates. Along with the subscription is a collection of initial data that were cached resources.

This didn't work quite as intended. The subscription (plus initial data) returned to the UI didn't wait for the data to be populated from the server, so it was always empty when Aspire started up or the user refreshed the browser on the resources page.

This PR updates the dashboard client to wait until initial data is populated before returning the subscription + initial data. The UI has more data to immediately render and the page finishes loading much faster.

Dashboard with 100 resources...

10+ seconds to load before (note the page scroll bar as data loads):
resources-before

1-2 seconds to load after:
resources-after

Microsoft Reviewers: Open in CodeFlow

@JamesNK
Copy link
Member Author

JamesNK commented Mar 1, 2024

A normal app like TestShop also feels faster 🚀

Before resources appear quickly over 1 second.
After resources all display immediately.

@JamesNK JamesNK force-pushed the jamesnk/dashboard-refresh-perf branch 2 times, most recently from f7254d3 to e5cdb71 Compare March 1, 2024 15:31
@DamianEdwards
Copy link
Member

The "No resources found" message before any show up bothers me a bit. What do we think about changing it to something like "Waiting for resources" or similar, so it doesn't sound so final and is more inline with the real-time nature of the view?

@JamesNK
Copy link
Member Author

JamesNK commented Mar 2, 2024

Slow loading might be related to microsoft/fluentui-blazor#1621. This PR reduces the number of re-renders which then causes fewer Expression.Compile calls. Regardless, this is still a good change.

@JamesNK
Copy link
Member Author

JamesNK commented Mar 2, 2024

The "No resources found" message before any show up bothers me a bit. What do we think about changing it to something like "Waiting for resources" or similar, so it doesn't sound so final and is more inline with the real-time nature of the view?

I noticed it too #2568

@davidfowl
Copy link
Member

@JamesNK are you going to rebase this change?

@JamesNK JamesNK force-pushed the jamesnk/dashboard-refresh-perf branch from e5cdb71 to a4780e7 Compare March 5, 2024 06:24
@JamesNK
Copy link
Member Author

JamesNK commented Mar 5, 2024

@JamesNK are you going to rebase this change?

Done

tenor

Review please 🙏

@JamesNK JamesNK merged commit 685f468 into main Mar 5, 2024
8 checks passed
@JamesNK JamesNK deleted the jamesnk/dashboard-refresh-perf branch March 5, 2024 07:34
@github-actions github-actions bot locked and limited conversation to collaborators Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants