Skip to content

Audit the 19 useSelector reads on Wallet home for expensive and unstable selectors #31493

Description

@MajorLift

Performance audit finding · Severity: Medium Ruled out · Resolution: closed after per-selector triage
File: app/components/Views/Wallet/index.tsx

Audit result (2026-06-10)

All 19 useSelector reads triaged; no expensive or unstable selector found:

  • 16 are memoized selectors returning primitives/booleans (feature flags, chain id, unread count) or stable controller-state references (the engine slice replaces only the changed controller's key per 250ms batched flush; BaseController v2 state is Immer-produced with structural sharing, so unchanged paths keep their references).
  • 3 are inline useSelector arrows returning primitives or a stable slice field (state.security.dataCollectionForMarketing, state.settings.basicFunctionalityEnabled, state.networkOnboarded.networkOnboardedState). A new arrow function per render is irrelevant to re-rendering — only the result identity matters — so these are reuse/style debt, not perf findings. Optional cleanup: promote to named selectors per app/selectors/ convention; no perf issue warranted.

Original finding (superseded by the audit above)

The Wallet home screen makes 19 separate useSelector calls; each was triaged for per-check cost and reference stability under the batched-sync dispatch cadence (app/core/Batcher/constants.ts 250ms flush, app/core/EngineService/EngineService.ts:38 unstable_batchedUpdates) and ruled out.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Fixed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions