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

All OnParameterSetAsync methods make calls synchronously #94

Open
modersohn opened this issue Apr 9, 2022 · 4 comments
Open

All OnParameterSetAsync methods make calls synchronously #94

modersohn opened this issue Apr 9, 2022 · 4 comments
Assignees

Comments

@modersohn
Copy link
Collaborator

modersohn commented Apr 9, 2022

Worst example is probably the accounts page. So many things are loaded with the various services, and everything is loaded one after the other, i.e. slow. No wonder it takes 10-15 seconds for an account with lots of NFTs to actually finish loading.

There's is no reason for doing all of that synchronously - but some things have to be done first and that makes it a bit tricky.

  1. loading the account itself, it's balances, the transactions and the NFT slots can all be done in parallel - because only the accountId is needed
  2. loading the NFT metadata should then be done in parallel too, not one-by-one
@modersohn modersohn self-assigned this Apr 9, 2022
@fudgebucket27
Copy link
Owner

This is a good idea way to got about it

@modersohn
Copy link
Collaborator Author

It's actually getting quite complicated. First, because you can only call StateHasChanged() from the main/UI thread and second, because there's so much interdependency here.

Then, according to https://docs.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-6.0#synchronization-context Blazor enforces a single thread anyway it seems? Which makes me wonder how we could get overlapping calls to OnSetParametersAsync like seen in #87?

Since the whole issue is "nice to have" and it works as is, I'd leave it as is for now.

@fudgebucket27
Copy link
Owner

Alright thats fine we can put this on the back burner for now then.

@modersohn
Copy link
Collaborator Author

@danielsolistensvik have you got any experience with this? Is Blazor still enforcing a single thread, like mentioned in the link above?

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

No branches or pull requests

2 participants