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

Merged
merged 6 commits into from
Apr 28, 2025

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 Requires smoke E2E testing 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

@owencraston owencraston force-pushed the chore/improve-account-list-performance branch 2 times, most recently from 535a211 to a14606e Compare April 28, 2025 18:55
@owencraston owencraston added Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Apr 28, 2025
Copy link
Contributor

github-actions bot commented Apr 28, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: a14606e
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/61c1b7b4-d097-4c94-b77f-502efa4cef07

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

@owencraston owencraston force-pushed the chore/improve-account-list-performance branch from ad0b9b0 to d2a8d0e Compare April 28, 2025 20:41
Copy link

@owencraston owencraston added no-changelog Indicates no external facing user changes, therefore no changelog documentation needed Run Smoke E2E Requires smoke E2E testing and removed Run Smoke E2E Requires smoke E2E testing labels Apr 28, 2025
Copy link
Contributor

github-actions bot commented Apr 28, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: d2a8d0e
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e75e803f-db77-48cb-b946-4762eb791611

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

@owencraston owencraston added the No QA Needed Apply this label when your PR does not need any QA effort. label Apr 28, 2025
@owencraston owencraston enabled auto-merge April 28, 2025 22:17
Copy link
Contributor

@vinnyhoward vinnyhoward left a comment

Choose a reason for hiding this comment

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

LGTM

@owencraston owencraston added this pull request to the merge queue Apr 28, 2025
Merged via the queue into main with commit 22d9f91 Apr 28, 2025
51 of 59 checks passed
@owencraston owencraston deleted the chore/improve-account-list-performance branch April 28, 2025 22:42
@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 2025
@metamaskbot metamaskbot added the release-7.47.0 Issue or pull request that will be included in release 7.47.0 label Apr 28, 2025
@gantunesr gantunesr added the area-performance Issues relating to slowness of app, cpu usage, and/or blank screens. label Jun 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-performance Issues relating to slowness of app, cpu usage, and/or blank screens. No QA Needed Apply this label when your PR does not need any QA effort. no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.47.0 Issue or pull request that will be included in release 7.47.0 Run Smoke E2E Requires smoke E2E testing team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants