Skip to content

chore: Improve account list performance #14910

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

owencraston
Copy link
Contributor

@owencraston owencraston commented Apr 26, 2025

Description

This is a minor PR that aims to improve the rendering performance of the AccountsList component with some basic tricks. This PR has no functional differences with what is already in main.

  1. extract inline functions into their own variables so that they can be memoized
  2. remove the need to iterate over all the accounts in the AccountsController. Instead we simple lookup the account via address.
  3. memoize the component
  4. memoize the icon selector with a shallow equal.

None of these will make massive improvements but they are best practices and could give us small benefits. It also makes the component easier to reason about.

Related issues

Fixes:

Manual testing steps

  1. create/import a wallet
  2. click on the selected account at the top of the screen
  3. once the account list opens, all of your accounts with the correct names and balances should render
  4. selecting a new account should change your selected account
  5. editing an account name should properly change the name in the list and the home page.

Screenshots/Recordings

Before

After

screen-20250425-203650.mp4

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@owencraston owencraston changed the title Chore/improve account list performance chore: Improve account list performance Apr 26, 2025
@owencraston owencraston marked this pull request as ready for review April 26, 2025 03:42
@owencraston owencraston added the Run Smoke E2E Triggers smoke e2e on Bitrise label Apr 26, 2025
Copy link
Contributor

github-actions bot commented Apr 26, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 9c3b255
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f1c178c6-ca67-49be-8b17-3033c3afbb5a

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
70.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run Smoke E2E Triggers smoke e2e on Bitrise team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants