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 performance & stability #232

Closed
5 of 8 tasks
sinzii opened this issue May 8, 2022 · 1 comment
Closed
5 of 8 tasks

Improve performance & stability #232

sinzii opened this issue May 8, 2022 · 1 comment
Assignees
Milestone

Comments

@sinzii
Copy link

sinzii commented May 8, 2022

Below is a list of works to improve SubWallet's performance & stability, feel free to create sub-issues to track each work.

Reduce memory consumption by replacing the heavy polkadot.js rpc client with our own light-weight client

It takes time to completely replace polkadot.js rpc client usage in SubWallet so we'll gradually replace it with out light-client API. This helps us see the improvement immediately without having to wait until we have a solution to completely replace polkadot.js rpc.

  • Implement lightweight Dotsama connector #217
  • Use full node connection only when needed, and disconnect when done
  • Improve light-weight client to deal with rpc methods that require complex type system (metadata), this helps us to completely move away from polkadot.js client.

Better handle unstable networks connections

It's really confusing and frustrating for users to see the loading Subwallet logo for a long time without any other feedback. This is due to the connections to networks are unstable or sometime unable to connect. We need to have a better way to deal with this.

  • Improve data fetching for better performance and UX #255
    • This helps users view the last updated data immediately
    • Along with that, we also need to update & cache the latest data when user open the popup
  • UI feedback for unstable network connections
    • This helps users have a better sense of why they were not able to see latest data

Reduce popup open time

SubWallet's popup has a relatively large & noticeable open time, this is mostly due to having a large bundle js size.

  • Reduce bundle js size by using dynamic imports for non-prioritized views to improve popup open time

Reduce stress to all networks by eliminating unused ws connections

Currently, we're connecting to all networks when users open browsers in both active and idle mode, this helps us get updates immediately from networks but accidentally put stress on all networks, even for networks that users don't have assets. This might get worse if we have more and more users.

We need to selectively pick networks to connect for users, so we'll only connect users to networks that they have assets. This will help networks to better optimize and allocate resources to serve users that really want to interact. We also want to disconnect to networks when the extension is in idle mode (after users close the popup xx minutes)

  • Using server to suggest which networks to connect for users
  • Disconnect to all networks while in idle mode
@hieudd
Copy link

hieudd commented Jun 29, 2022

Will implement when rebuilding architecture for Manifest V3 in #349

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

4 participants