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: loading spinner for assets table #1641

Merged
merged 8 commits into from
Aug 28, 2024

Conversation

vacekj
Copy link
Member

@vacekj vacekj commented Aug 5, 2024

re-fixes #1381

Copy link

changeset-bot bot commented Aug 5, 2024

⚠️ No Changeset found

Latest commit: 5efc371

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vacekj vacekj marked this pull request as ready for review August 5, 2024 10:37
@TalDerei TalDerei self-requested a review August 5, 2024 11:20
Copy link
Contributor

@Valentine1898 Valentine1898 left a comment

Choose a reason for hiding this comment

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

More manual testing is needed, it seems to be loading my balances many times slower than before

@TalDerei
Copy link
Contributor

TalDerei commented Aug 5, 2024

More manual testing is needed, it seems to be loading my balances many times slower than before

seemed relatively performant to me during testing?

@Valentine1898
Copy link
Contributor

More manual testing is needed, it seems to be loading my balances many times slower than before

seemed relatively performant to me during testing?

In the penumbra-1 chain, my balances take ~21 sec to load
don't merge this PR

@TalDerei
Copy link
Contributor

TalDerei commented Aug 5, 2024

can you add a changeset?

@TalDerei
Copy link
Contributor

TalDerei commented Aug 5, 2024

More manual testing is needed, it seems to be loading my balances many times slower than before

seemed relatively performant to me during testing?

In the penumbra-1 chain, my balances take ~21 sec to load don't merge this PR

More manual testing is needed, it seems to be loading my balances many times slower than before

seemed relatively performant to me during testing?

In the penumbra-1 chain, my balances take ~21 sec to load don't merge this PR

interesting, I didn't test penumbra-1

@Valentine1898
Copy link
Contributor

Screen.Recording.2024-08-05.at.17.39.07.mov

@vacekj
Copy link
Member Author

vacekj commented Aug 12, 2024

@Valentine1898 ack, debugging..

@vacekj vacekj self-assigned this Aug 12, 2024
@vacekj vacekj force-pushed the 1381-assets-table-status--streaming branch from 3901e70 to 49d2b93 Compare August 14, 2024 20:01
@vacekj vacekj linked an issue Aug 15, 2024 that may be closed by this pull request
@vacekj vacekj force-pushed the 1381-assets-table-status--streaming branch from 49d2b93 to c27e30a Compare August 19, 2024 13:41
@TalDerei
Copy link
Contributor

TalDerei commented Aug 19, 2024

following up, was the performance regression here fixed? I haven't retested it myself yet

@vacekj
Copy link
Member Author

vacekj commented Aug 19, 2024

@VanishMax can you try to repro this? I can't seem to repro locally with the test account on mainnet.

@grod220
Copy link
Collaborator

grod220 commented Aug 20, 2024

I can't reproduce any slowness, but @JasonMHasperhoven can you test this out on testnet with the testnet whale seedphrase given you have an older macbook?

@TalDerei
Copy link
Contributor

TalDerei commented Aug 20, 2024

I can't reproduce the slowness either using the whale account on mainnet

Screen.Recording.2024-08-19.at.8.41.48.PM.mov
Screen.Recording.2024-08-19.at.8.56.29.PM.mov

@vacekj
Copy link
Member Author

vacekj commented Aug 20, 2024

also can't see why the CI is failing but my local is passing - debugging now.

@vacekj
Copy link
Member Author

vacekj commented Aug 20, 2024

CI is fixed now, it was an eslint compat problem.

@vacekj vacekj force-pushed the 1381-assets-table-status--streaming branch from f9429dd to dc1926d Compare August 20, 2024 15:41
@JasonMHasperhoven
Copy link
Contributor

@grod220
Copy link
Collaborator

grod220 commented Aug 21, 2024

Using testnet on my 2019 macbook: https://github.com/user-attachments/assets/1f09cdaf-067e-42a8-8263-32d044f8bf1a

This is a compelling test. Why would streaming balances not be basically instant for a slower machine? The balances steps are this:

  • Query notes from database
  • Combine notes that are the same asset id + account
  • Stream results back to the client
  • React renders result (via ZQuery)

This leads me to believe there is a react rendering kind of performance drag.

@JasonMHasperhoven, another helpful test would be to make the same query on main and see how fast that is compared to this. If it's faster, that means it's a react rendering issue. If not, that means the rpc method (or db calls) in the extension is slower for lower performance machines.

@Valentine1898
Copy link
Contributor

Valentine1898 commented Aug 21, 2024

Screen.Recording.2024-08-05.at.17.39.07.mov

Additional context
I tested on my macbook m3 pro
The mainnet wallet I tested on has about 3000 notes on it
Loading balances in the main branch is 20 times faster for me

@grod220
Copy link
Collaborator

grod220 commented Aug 21, 2024

Also @vacekj, just realized we want the spinner to be showing (in a place that doesn't block the content) during the entire stream lifetime. At the moment, it looks like it goes away after the first item is loaded. Can we also use Linewave for the spinner (we use it in other places).

@vacekj
Copy link
Member Author

vacekj commented Aug 21, 2024

@grod220 good point, will address this now.

@vacekj vacekj force-pushed the 1381-assets-table-status--streaming branch from dc1926d to ffe5fd5 Compare August 21, 2024 18:18
@vacekj
Copy link
Member Author

vacekj commented Aug 21, 2024

@grod220 addressed in the latest commit. the correct loading indicator will now show until the stream has finished.

@TalDerei
Copy link
Contributor

TalDerei commented Aug 22, 2024

@vacekj still unclear if there's a performance regression?

@vacekj
Copy link
Member Author

vacekj commented Aug 26, 2024

@TalDerei I can't replicate the perf regression on my machine, and don't see any obvious issues with code. Even with the perf. regression, this feels like better UX than before, so would carefully merge and watch for potential use reports.

Alternatively, I can try debugging with @JasonMHasperhoven on his machine to see what's wrong.

@grod220 would love your call here.

@vacekj vacekj force-pushed the 1381-assets-table-status--streaming branch from 64e6588 to 3441cee Compare August 28, 2024 18:17
@vacekj vacekj merged commit ee2e34d into main Aug 28, 2024
6 checks passed
@vacekj vacekj deleted the 1381-assets-table-status--streaming branch August 28, 2024 18:33
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

Successfully merging this pull request may close these issues.

Fix and enable streaming in balances Assets table status + streaming
5 participants