perf(6596): audit createDeepEqualSelector usage#41490
Conversation
|
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. |
✨ Files requiring CODEOWNER review ✨🔑 @MetaMask/accounts-engineers (1 files, +1 -1)
✅ @MetaMask/confirmations (2 files, +2 -2)
🫰 @MetaMask/core-platform (2 files, +2 -2)
🔔 @MetaMask/notifications (4 files, +91 -16)
🔄 @MetaMask/swaps-engineers (1 files, +1 -1)
|
2d21371 to
7db465b
Compare
Builds ready [7db465b]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 12 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [5dfe952]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs
|
5dfe952 to
6c603c9
Compare
Builds ready [676f823]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs
|
…lector-audit' into refactore/6596-createDeepEqualSelector-audit
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c89236f. Configure here.
|
Builds ready [c89236f]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs
|




[skip-e2e]
Description
We’re reviewing where
createDeepEqualSelectoris used so we only pay deep-equality memoization where it’s justified. Some selectors were using it for cheap derivations or for parameterized “factory” selectors, which is easy to misuse and can add avoidable work. What is included in this PR:Changelog
CHANGELOG entry: null
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6596
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches a broad set of Redux selectors and memoization strategies; while intended to be behavior-preserving, changes could subtly affect memoization/caching and trigger unexpected re-renders or stale/extra recomputations.
Overview
Reduces unnecessary deep-equality selector memoization by switching several cheap/stable selectors from
createDeepEqualSelectortocreateSelector, and by updating imports to useshared/lib/selectors/selector-creatorsdirectly (removing theshared/lib/selectors/utilre-export).Fixes parameterized notification lookup by replacing the per-id selector factory
getMetamaskNotificationById(id)with a bounded LRUcreateParameterizedSelectorimplementationgetMetamaskNotificationById(state, id), updatingNotificationDetailsto use the new signature viauseAppSelector, and adding coverage for the missing-notification redirect and selector behavior.Reviewed by Cursor Bugbot for commit c89236f. Bugbot is set up for automated code reviews on this repo. Configure here.