Skip to content

fix: getPendingApprovals broken selector memoization to prevent global cascading re-renders#39312

Merged
MajorLift merged 6 commits intomainfrom
copilot/fix-get-pending-approvals-selector
Jan 23, 2026
Merged

fix: getPendingApprovals broken selector memoization to prevent global cascading re-renders#39312
MajorLift merged 6 commits intomainfrom
copilot/fix-get-pending-approvals-selector

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 16, 2026

Description

getPendingApprovals was creating a new array on every call via Object.values(), breaking memoization in the Routes component and triggering cascade re-renders across ~50-60 child components on every state change.

Changes:

  • Wrapped getPendingApprovals in createSelector to memoize the Object.values() transformation
  • Added helper function getPendingApprovalsObject to extract the pendingApprovals object
  • Returns stable reference when underlying pendingApprovals object is unchanged

Implementation:

// Before: new array every call
export function getPendingApprovals(state: ApprovalsMetaMaskState) {
  return Object.values(state.metamask.pendingApprovals ?? {});
}

// After: memoized transformation
const getPendingApprovalsObject = (state: ApprovalsMetaMaskState) =>
  state.metamask.pendingApprovals ?? {};

export const getPendingApprovals = createSelector(
  getPendingApprovalsObject,
  (approvals) => Object.values(approvals),
);

Testing:

  • Added unit tests verifying reference equality on repeated calls with identical state
  • Tests verify invalidation when pendingApprovals actually change
  • All existing tests pass (664 selector tests across 31 suites)
  • Covers edge cases (empty object, null/undefined values)

Changelog

CHANGELOG entry: Fixed critical performance issue slowing down all user actions by fixing approvals selector memoization

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6673

  • Part of #6669 — Break Global Re-render Cascade

Manual testing steps

  1. Open MetaMask extension
  2. Navigate to any page that triggers state changes (e.g., switching networks, accounts)
  3. Observe improved responsiveness compared to before (Routes component and children no longer re-render unnecessarily)
  4. Verify approvals functionality works correctly (no behavioral changes)

Screenshots/Recordings

Before

N/A - Performance improvement (internal optimization, no UI changes)

After

N/A - Performance improvement (internal optimization, no UI changes)

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.

Note

Optimizes approvals selectors to avoid unnecessary renders by stabilizing outputs and handling empty/null states.

  • Wraps getPendingApprovals with createSelector and adds getPendingApprovalsObject using EMPTY_OBJECT fallback
  • Converts pendingApprovalsSortedSelector to a memoized selector that sorts a copied array
  • Leaves existing APIs intact while returning stable references when pendingApprovals is unchanged
  • Adds unit tests validating memoization, change invalidation, and empty/null behavior

Written by Cursor Bugbot for commit 4984401. This will update automatically on new commits. Configure here.

Copilot AI changed the title [WIP] Fix getPendingApprovals selector for memoization Fix getPendingApprovals selector memoization to prevent cascade re-renders Jan 16, 2026
Copilot AI requested a review from MajorLift January 16, 2026 05:03
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 16, 2026

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.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Jan 16, 2026

Builds ready [e1a1618]
UI Startup Metrics (1305 ± 107 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13051042157310713681519
load--1097870138111211621303
domContentLoaded--1090867137311111541294
domInteractive--2815120202484
firstPaint--169621292128192298
backgroundConnect--21619624710221242
firstReactRender--17103861930
getState--371676124264
initialActions--105113
loadScripts--88165211731109451076
setupStore--1262941421
numNetworkReqs--171170151163
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--18661435273321319882276
load--1015897175112710201320
domContentLoaded--1001890174312810041313
domInteractive--33171452332100
firstPaint--191701282131233290
backgroundConnect--275201744129243617
firstReactRender--21153732227
getState--17813274464194238
initialActions--104111
loadScripts--79169015181247921067
setupStore--17106681835
numNetworkReqs--60372163058139
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--801642112490852995
load--64357199473672804
domContentLoaded--63856598873665795
domInteractive--2414123192177
firstPaint--1096064671146208
backgroundConnect--285117324597
firstReactRender--16103241824
getState--3215140173857
initialActions--104111
loadScripts--63456398572661787
setupStore--1264771329
numNetworkReqs--181181181169
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1347883222128415781923
load--675596114890675891
domContentLoaded--666589113990663883
domInteractive--34161432630105
firstPaint--1316449678170290
backgroundConnect--118860120241574
firstReactRender--22163132430
getState--14812521918156178
initialActions--107111
loadScripts--663587113189659874
setupStore--1765091742
numNetworkReqs--1023726250137232
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14901138244320716071945
load--1195952215517112741428
domContentLoaded--1195952215517112741428
domInteractive--8834968100106158
firstPaint--------
backgroundConnect--792130565129212
firstReactRender--14104841418
getState--146141181225
initialActions--103122
loadScripts--1144937201414412011370
setupStore--134111141239
numNetworkReqs--20984201476
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--25061913539266524864069
load--12341011266728912091796
domContentLoaded--12341011266728912091796
domInteractive--1133550392115387
firstPaint--------
backgroundConnect--11333602111108477
firstReactRender--2414121142453
getState--29468982240466788
initialActions--217123
loadScripts--1181970264825811611577
setupStore--15710776203129670
numNetworkReqs--60301693786161
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15511306202418117311898
load--12961093164812113901553
domContentLoaded--12961087164812113901553
domInteractive--74282304193139
firstPaint--------
backgroundConnect--63202505173176
firstReactRender--1510140131419
getState--188128221472
initialActions--103122
loadScripts--12601077155810813511465
setupStore--2242833914114
numNetworkReqs--20981191577
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29011902675989733774685
load--16581196346063116443186
domContentLoaded--16571196346063116443186
domInteractive--133311142186105458
firstPaint--------
backgroundConnect--1712711872631331166
firstReactRender--23147182634
getState--31866867257516825
initialActions--216123
loadScripts--15591166322351816252923
setupStore--91572311785348
numNetworkReqs--59291673977161
19--------
📊 Page Load Benchmark Results

Current Commit: e1a1618 | Date: 1/16/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±71ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 727ms (±69ms) 🟢 | historical mean value: 724ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±15ms) 🟢 | historical mean value: 76ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 71ms 1.00s 1.35s 1.25s 1.35s
domContentLoaded 727ms 69ms 694ms 1.02s 922ms 1.02s
firstPaint 77ms 15ms 56ms 208ms 84ms 208ms
firstContentfulPaint 77ms 15ms 56ms 208ms 84ms 208ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 57 Bytes (0%)

@MajorLift MajorLift changed the title Fix getPendingApprovals selector memoization to prevent cascade re-renders fix: getPendingApprovals broken selector memoization to prevent global cascading re-renders Jan 16, 2026
@MajorLift MajorLift force-pushed the copilot/fix-get-pending-approvals-selector branch from e1a1618 to 92acebb Compare January 16, 2026 21:56
@MajorLift

This comment was marked as resolved.

This comment was marked as resolved.

@MajorLift MajorLift requested review from a team and removed request for MajorLift January 16, 2026 22:22
@MajorLift MajorLift marked this pull request as ready for review January 16, 2026 22:44
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Jan 16, 2026

Builds ready [fea5212]
UI Startup Metrics (1271 ± 116 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12711050157711613291518
load--1078875136110611271292
domContentLoaded--1073872135510511221286
domInteractive--2615111182376
firstPaint--1486288298184276
backgroundConnect--21520125510219238
firstReactRender--15103441724
getState--361872114062
initialActions--104112
loadScripts--86466611431049151078
setupStore--1253241422
numNetworkReqs--17973161167
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--18361550233116419302237
load--1021905138811910441299
domContentLoaded--1009893138012010351290
domInteractive--33171772531100
firstPaint--16766900110201381
backgroundConnect--260206673105239583
firstReactRender--20153932126
getState--16712929229180222
initialActions--102111
loadScripts--79767811721178131075
setupStore--1794571837
numNetworkReqs--58371372359125
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--778637119984826895
load--62356878254644748
domContentLoaded--61856477754637743
domInteractive--241585172075
firstPaint--1075864286121195
backgroundConnect--324133345898
firstReactRender--1493131620
getState--311577154164
initialActions--105111
loadScripts--61456276953635734
setupStore--1053451117
numNetworkReqs--171172161167
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14221020241628015891999
load--720605116799735956
domContentLoaded--710597116099723940
domInteractive--36171222639112
firstPaint--1516545484202352
backgroundConnect--105769319425576
firstReactRender--24184252635
getState--15912726121171191
initialActions--103112
loadScripts--707594114397718930
setupStore--171062101743
numNetworkReqs--983723850134226
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13911077185517414901742
load--1124930157012812191383
domContentLoaded--1124930156912812181382
domInteractive--72312304494160
firstPaint--------
backgroundConnect--63202264982184
firstReactRender--12105041216
getState--136107121330
initialActions--103112
loadScripts--1084912145610611531282
setupStore--136101121235
numNetworkReqs--20982201477
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--24431822505764224104387
load--12511020234230912622142
domContentLoaded--12501020234230912622142
domInteractive--12838833128116392
firstPaint--------
backgroundConnect--1032351686118253
firstReactRender--231460102356
getState--27152890228440733
initialActions--217123
loadScripts--1194952221925612031901
setupStore--1269689158130593
numNetworkReqs--60281673879163
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16161331228118417491966
load--13501134178812814391572
domContentLoaded--13491133178812814391572
domInteractive--952923348131163
firstPaint--------
backgroundConnect--61202174483160
firstReactRender--16115881724
getState--217221301597
initialActions--102122
loadScripts--13101117158510913681529
setupStore--164128181556
numNetworkReqs--19979191375
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28941953628181928314682
load--16371160335855916572817
domContentLoaded--16371160335855916562817
domInteractive--11730983145107362
firstPaint--------
backgroundConnect--1923012832711641138
firstReactRender--23153752632
getState--25874910212363701
initialActions--204123
loadScripts--15281141315246115922628
setupStore--1317774184120695
numNetworkReqs--58281633877159
19--------
📊 Page Load Benchmark Results

Current Commit: fea5212 | Date: 1/16/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 988ms (±40ms) 🟢 | historical mean value: 1.03s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 687ms (±61ms) 🟢 | historical mean value: 719ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±40ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 988ms 40ms 963ms 1.28s 1.02s 1.28s
domContentLoaded 687ms 61ms 663ms 1.24s 696ms 1.24s
firstPaint 79ms 40ms 64ms 476ms 84ms 476ms
firstContentfulPaint 79ms 40ms 64ms 476ms 84ms 476ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 57 Bytes (0%)

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Jan 20, 2026

Builds ready [1ce7ca4]
UI Startup Metrics (1309 ± 109 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13091054156810913821519
load--1095877134310811591299
domContentLoaded--1089872133710711451296
domInteractive--2716130202280
firstPaint--164681156141188300
backgroundConnect--22320429215226255
firstReactRender--16109591825
getState--3717103134162
initialActions--1010112
loadScripts--87367311241079281074
setupStore--1373551424
numNetworkReqs--181178181170
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--18731568245017419512277
load--1029910167711910451315
domContentLoaded--1016903166812010291297
domInteractive--33172252932102
firstPaint--172701316136216333
backgroundConnect--275210617111246586
firstReactRender--22166362334
getState--18013570578189216
initialActions--104112
loadScripts--79868714351188141077
setupStore--16104361731
numNetworkReqs--59391362360122
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--8226741064808591012
load--65959285864672810
domContentLoaded--65458885463667805
domInteractive--251690162274
firstPaint--1096133654145211
backgroundConnect--266126263498
firstReactRender--16113341726
getState--3515168194260
initialActions--105112
loadScripts--65258685262665800
setupStore--1464281835
numNetworkReqs--171180171168
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13811022204625915871896
load--69160496183702918
domContentLoaded--68159895383690911
domInteractive--34171342533106
firstPaint--1376442272177282
backgroundConnect--88763717819549
firstReactRender--22163642433
getState--14713119312152176
initialActions--103111
loadScripts--67959694581688903
setupStore--1775691744
numNetworkReqs--933923547134217
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14331118206820015491855
load--1151948182414712181471
domContentLoaded--1150948182414812181470
domInteractive--70311983991147
firstPaint--------
backgroundConnect--57222084656158
firstReactRender--1393851324
getState--156213231336
initialActions--103122
loadScripts--1118933168213511541366
setupStore--144159191148
numNetworkReqs--19983191374
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--24241758487858124353965
load--1231986265735111862505
domContentLoaded--1231986265635111862505
domInteractive--1043339073111309
firstPaint--------
backgroundConnect--11024963151102432
firstReactRender--221491112232
getState--29461987249517780
initialActions--217123
loadScripts--1192969260433611402444
setupStore--14761452230119641
numNetworkReqs--5132109217286
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16171308220317517211982
load--1359114316339814221536
domContentLoaded--1359114216339814221536
domInteractive--982923043129181
firstPaint--------
backgroundConnect--69183536187210
firstReactRender--14101921519
getState--2782364915206
initialActions--102122
loadScripts--1320112415168113751438
setupStore--2152594013107
numNetworkReqs--19983171469
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29602218714991728094883
load--17041236585670416773105
domContentLoaded--17041236585670416773105
domInteractive--131301185193113424
firstPaint--------
backgroundConnect--1962422633411351153
firstReactRender--23165152631
getState--27774837225395783
initialActions--203123
loadScripts--16061218583161016112803
setupStore--13571446218117653
numNetworkReqs--5027179246698
19--------
📊 Page Load Benchmark Results

Current Commit: 1ce7ca4 | Date: 1/20/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±37ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 720ms (±34ms) 🟢 | historical mean value: 734ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±12ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 37ms 1.01s 1.30s 1.08s 1.30s
domContentLoaded 720ms 34ms 697ms 966ms 747ms 966ms
firstPaint 76ms 12ms 60ms 188ms 84ms 188ms
firstContentfulPaint 76ms 12ms 60ms 188ms 84ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 128.88 KiB (2.57%)
  • ui: 2.54 KiB (0.03%)
  • common: 234.09 KiB (2.59%)

@MajorLift MajorLift marked this pull request as ready for review January 20, 2026 19:27
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Jan 20, 2026

Builds ready [f1cd417]
UI Startup Metrics (1289 ± 119 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12891042169811913561535
load--1085859148111011381332
domContentLoaded--1078857147611011321320
domInteractive--251692182280
firstPaint--145641084115183298
backgroundConnect--21720226010220240
firstReactRender--15103241723
getState--361875104061
initialActions--104112
loadScripts--86865812611109231105
setupStore--1264651319
numNetworkReqs--171176161167
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--19721507256121420812450
load--1082942147912710961392
domContentLoaded--1067934146812710751381
domInteractive--36181262437108
firstPaint--226711432233235449
backgroundConnect--27022164188260547
firstReactRender--22174652335
getState--194140770102196252
initialActions--105112
loadScripts--83871412351218351142
setupStore--19124872134
numNetworkReqs--59371402564129
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--8326781042838871002
load--67560391978696852
domContentLoaded--66959791377682842
domInteractive--261694192382
firstPaint--1016327449107219
backgroundConnect--2951393333111
firstReactRender--16112941825
getState--3415149214358
initialActions--103112
loadScripts--66659590476677833
setupStore--1363971435
numNetworkReqs--181182181168
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1405919212827715922042
load--7196241347105731928
domContentLoaded--7106191336105715922
domInteractive--36181542535105
firstPaint--1396671186176280
backgroundConnect--91765016956538
firstReactRender--23173742531
getState--15313420114163183
initialActions--104111
loadScripts--7076171327103712915
setupStore--1695271738
numNetworkReqs--943730752130234
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14051068212619515551753
load--1125927144812512231368
domContentLoaded--1124927144712512231368
domInteractive--72322004297145
firstPaint--------
backgroundConnect--57201684285142
firstReactRender--1394861331
getState--155145221336
initialActions--102122
loadScripts--1086914143010511501261
setupStore--13372121238
numNetworkReqs--19984181374
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--25041931535073524624302
load--1252977277437511962578
domContentLoaded--1251977277437511962577
domInteractive--11036974110117255
firstPaint--------
backgroundConnect--132221229195108554
firstReactRender--2215105122330
getState--25871826216316736
initialActions--206123
loadScripts--1200961262533911462237
setupStore--1525757191185639
numNetworkReqs--4928100217390
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16271276232918517341970
load--13711112169112414751592
domContentLoaded--13701112169112414751592
domInteractive--833021846123163
firstPaint--------
backgroundConnect--68184016181189
firstReactRender--15115241518
getState--237339471567
initialActions--102022
loadScripts--13271092161010614001507
setupStore--164192241352
numNetworkReqs--19978181373
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29772146747394138214613
load--17171204599274216413124
domContentLoaded--17171204599274216413124
domInteractive--149314010406106422
firstPaint--------
backgroundConnect--163271197219157867
firstReactRender--221410292529
getState--24084862194284762
initialActions--208123
loadScripts--16351180597168016022940
setupStore--1081082916495530
numNetworkReqs--492690197285
19--------
📊 Page Load Benchmark Results

Current Commit: f1cd417 | Date: 1/20/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±40ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 740ms (±38ms) 🟢 | historical mean value: 734ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±10ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 40ms 1.02s 1.35s 1.09s 1.35s
domContentLoaded 740ms 38ms 709ms 1.02s 772ms 1.02s
firstPaint 79ms 10ms 64ms 160ms 84ms 160ms
firstContentfulPaint 79ms 10ms 64ms 160ms 84ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 145 Bytes (0%)

@MajorLift MajorLift removed their request for review January 20, 2026 20:56
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Jan 21, 2026

Builds ready [0f442cc]
UI Startup Metrics (1292 ± 111 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12921057160811113521510
load--1088891141811011471309
domContentLoaded--1082883141011011401304
domInteractive--261691182277
firstPaint--168651153149189276
backgroundConnect--21619929612219233
firstReactRender--1493641624
getState--34148693849
initialActions--103112
loadScripts--87367412041109301080
setupStore--1365771425
numNetworkReqs--171175161164
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--294414438159151536866129
load--1114918159913712211377
domContentLoaded--1096904158913312091359
domInteractive--36192363132105
firstPaint--181821371144222344
backgroundConnect--63821359987927452263
firstReactRender--22164152432
getState--2791371882262235875
initialActions--106112
loadScripts--87070713251249481110
setupStore--246175202656
numNetworkReqs--87352333892173
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--786652110782814953
load--64257191773657826
domContentLoaded--63856790873653817
domInteractive--2415102162170
firstPaint--1106161672147203
backgroundConnect--265124273491
firstReactRender--15102741622
getState--3315141214156
initialActions--103112
loadScripts--63556590672651815
setupStore--1153651219
numNetworkReqs--171171161166
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1279970223822714021663
load--67757891877693859
domContentLoaded--66757091277682853
domInteractive--36181332437105
firstPaint--1506436769206287
backgroundConnect--3084516817215
firstReactRender--22163442531
getState--16513926019175197
initialActions--103011
loadScripts--66456790576680845
setupStore--21863121947
numNetworkReqs--995126041104208
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--13871096191018114641785
load--1116946147611711761376
domContentLoaded--1115946147611711761375
domInteractive--72313134793159
firstPaint--------
backgroundConnect--55203875454190
firstReactRender--12103631316
getState--137118141040
initialActions--604624622
loadScripts--1086923145710411501324
setupStore--145108161247
numNetworkReqs--19976181374
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--24621966344233427033011
load--1187992185614012701443
domContentLoaded--1186989185614012701443
domInteractive--15146805115177388
firstPaint--------
backgroundConnect--291351611297440880
firstReactRender--21145472328
getState--22160800163268582
initialActions--203123
loadScripts--1147975181013412211413
setupStore--12020584115151382
numNetworkReqs--77341382387129
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15621310221617116701892
load--13211114194212213841506
domContentLoaded--13201113194112213841506
domInteractive--882921142129152
firstPaint--------
backgroundConnect--56202514166140
firstReactRender--14115551522
getState--197167271566
initialActions--102022
loadScripts--12871098182510813511462
setupStore--1932073112106
numNetworkReqs--18980171468
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--28762250596153231103712
load--15361257467940216002456
domContentLoaded--15361257467940216002456
domInteractive--14942493101166392
firstPaint--------
backgroundConnect--4114730404365991132
firstReactRender--2516257272430
getState--224821315190229652
initialActions--203123
loadScripts--14671229248224915791889
setupStore--11721580110144355
numNetworkReqs--76301682782146
19--------
📊 Page Load Benchmark Results

Current Commit: 0f442cc | Date: 1/21/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±39ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 726ms (±37ms) 🟢 | historical mean value: 725ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 39ms 1.01s 1.31s 1.08s 1.31s
domContentLoaded 726ms 37ms 700ms 986ms 752ms 986ms
firstPaint 77ms 10ms 60ms 160ms 84ms 160ms
firstContentfulPaint 77ms 10ms 60ms 160ms 84ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 145 Bytes (0%)

@MajorLift MajorLift force-pushed the copilot/fix-get-pending-approvals-selector branch from 0f442cc to f1cd417 Compare January 21, 2026 20:11
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Jan 21, 2026

Builds ready [f1cd417]
UI Startup Metrics (1252 ± 106 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12521009149110613101447
load--105185313079511001244
domContentLoaded--104684713019510951239
domInteractive--251699172179
firstPaint--146641062112182284
backgroundConnect--21419426212217241
firstReactRender--1492841523
getState--35187893955
initialActions--106112
loadScripts--8386491098938881014
setupStore--1264051420
numNetworkReqs--171177151160
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--------
load--------
domContentLoaded--------
domInteractive--------
firstPaint--------
backgroundConnect--------
firstReactRender--------
getState--------
initialActions--------
loadScripts--------
setupStore--------
numNetworkReqs--------
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--855696108680908996
load--70060686570757842
domContentLoaded--69460385770751836
domInteractive--271696192583
firstPaint--1156435057155224
backgroundConnect--226118262894
firstReactRender--17114261932
getState--321688164265
initialActions--104112
loadScripts--69160085568749827
setupStore--1364361526
numNetworkReqs--181178171170
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1422977323932415292070
load--7396401217104747960
domContentLoaded--7286311202103738951
domInteractive--3720162253898
firstPaint--1506849480174319
backgroundConnect--68863614724538
firstReactRender--23173342531
getState--17113975365170218
initialActions--102011
loadScripts--7256281199102735941
setupStore--1895891842
numNetworkReqs--964024948134212
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14201109205718215191803
load--1138936160711112121327
domContentLoaded--1138936160611112111327
domInteractive--71332264390161
firstPaint--------
backgroundConnect--54203944955147
firstReactRender--13104251320
getState--246542611493
initialActions--103122
loadScripts--110491814769311701231
setupStore--145114151441
numNetworkReqs--18971161367
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--273517558084100929774614
load--12571008319532113351796
domContentLoaded--12571008319532113351795
domInteractive--159341497195150476
firstPaint--------
backgroundConnect--3794255156574791491
firstReactRender--22157092335
getState--285684200458316750
initialActions--213123
loadScripts--1208975316431012771730
setupStore--11012751138110503
numNetworkReqs--6018114217693
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15251274229117815541999
load--13081097188712113651525
domContentLoaded--13081097188712113651518
domInteractive--862723043120145
firstPaint--------
backgroundConnect--51172594046140
firstReactRender--14115141417
getState--178154221571
initialActions--106122
loadScripts--12781084187211313171456
setupStore--135138161137
numNetworkReqs--19981181373
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29932068611488334215176
load--15021167329036815492573
domContentLoaded--15021167329036815492573
domInteractive--12933683101168303
firstPaint--------
backgroundConnect--4292527405068901304
firstReactRender--2415100112552
getState--278671082242370829
initialActions--213123
loadScripts--14181151303324814681836
setupStore--146141569230132646
numNetworkReqs--6223138227795
19--------
📊 Page Load Benchmark Results

Current Commit: f1cd417 | Date: 1/21/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±38ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 718ms (±36ms) 🟢 | historical mean value: 718ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 38ms 1.00s 1.30s 1.07s 1.30s
domContentLoaded 718ms 36ms 692ms 977ms 741ms 977ms
firstPaint 77ms 10ms 60ms 160ms 88ms 160ms
firstContentfulPaint 77ms 10ms 60ms 160ms 88ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 4.88 KiB (0.09%)
  • ui: -31.5 KiB (-0.4%)
  • common: -136.32 KiB (-1.47%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Jan 21, 2026

Builds ready [f1cd417]
UI Startup Metrics (1252 ± 106 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12521009149110613101447
load--105185313079511001244
domContentLoaded--104684713019510951239
domInteractive--251699172179
firstPaint--146641062112182284
backgroundConnect--21419426212217241
firstReactRender--1492841523
getState--35187893955
initialActions--106112
loadScripts--8386491098938881014
setupStore--1264051420
numNetworkReqs--171177151160
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--2226143810747131020514781
load--1051928145511710821314
domContentLoaded--1037911143711810721308
domInteractive--37172463136107
firstPaint--2337814492542331086
backgroundConnect--3662108483830247644
firstReactRender--22156162329
getState--2411362622307203737
initialActions--104112
loadScripts--82170212081138481093
setupStore--19781111942
numNetworkReqs--61272062772109
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--855696108680908996
load--70060686570757842
domContentLoaded--69460385770751836
domInteractive--271696192583
firstPaint--1156435057155224
backgroundConnect--226118262894
firstReactRender--17114261932
getState--321688164265
initialActions--104112
loadScripts--69160085568749827
setupStore--1364361526
numNetworkReqs--181178171170
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1422977323932415292070
load--7396401217104747960
domContentLoaded--7286311202103738951
domInteractive--3720162253898
firstPaint--1506849480174319
backgroundConnect--68863614724538
firstReactRender--23173342531
getState--17113975365170218
initialActions--102011
loadScripts--7256281199102735941
setupStore--1895891842
numNetworkReqs--964024948134212
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--14201109205718215191803
load--1138936160711112121327
domContentLoaded--1138936160611112111327
domInteractive--71332264390161
firstPaint--------
backgroundConnect--54203944955147
firstReactRender--13104251320
getState--246542611493
initialActions--103122
loadScripts--110491814769311701231
setupStore--145114151441
numNetworkReqs--18971161367
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--273517558084100929774614
load--12571008319532113351796
domContentLoaded--12571008319532113351795
domInteractive--159341497195150476
firstPaint--------
backgroundConnect--3794255156574791491
firstReactRender--22157092335
getState--285684200458316750
initialActions--213123
loadScripts--1208975316431012771730
setupStore--11012751138110503
numNetworkReqs--6018114217693
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15251274229117815541999
load--13081097188712113651525
domContentLoaded--13081097188712113651518
domInteractive--862723043120145
firstPaint--------
backgroundConnect--51172594046140
firstReactRender--14115141417
getState--178154221571
initialActions--106122
loadScripts--12781084187211313171456
setupStore--135138161137
numNetworkReqs--19981181373
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29932068611488334215176
load--15021167329036815492573
domContentLoaded--15021167329036815492573
domInteractive--12933683101168303
firstPaint--------
backgroundConnect--4292527405068901304
firstReactRender--2415100112552
getState--278671082242370829
initialActions--213123
loadScripts--14181151303324814681836
setupStore--146141569230132646
numNetworkReqs--6223138227795
19--------
📊 Page Load Benchmark Results

Current Commit: f1cd417 | Date: 1/21/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±38ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 718ms (±36ms) 🟢 | historical mean value: 718ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 38ms 1.00s 1.30s 1.07s 1.30s
domContentLoaded 718ms 36ms 692ms 977ms 741ms 977ms
firstPaint 77ms 10ms 60ms 160ms 88ms 160ms
firstContentfulPaint 77ms 10ms 60ms 160ms 88ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 4.88 KiB (0.09%)
  • ui: -31.5 KiB (-0.4%)
  • common: -136.32 KiB (-1.47%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Jan 22, 2026

Builds ready [4984401]
UI Startup Metrics (1263 ± 110 ms)
PlatformBuildTypePageMetricTest Title (ms)Persona (ms)Mean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--12631005160911013321420
load--1063858140510011201224
domContentLoaded--105685513999911141219
domInteractive--2515115192172
firstPaint--1346331654179217
backgroundConnect--21519734217217241
firstReactRender--1594551525
getState--3518107123957
initialActions--103112
loadScripts--8486561189999061012
setupStore--1274561225
numNetworkReqs--181274151265
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--313515428763144942465764
load--1151913160214012541427
domContentLoaded--1135902157913912311408
domInteractive--3418151243497
firstPaint--2777714472832601107
backgroundConnect--798208323482311272874
firstReactRender--21163542330
getState--343682738380329833
initialActions--102111
loadScripts--90369413391349991187
setupStore--17659112040
numNetworkReqs--934923138101209
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--806652100081845972
load--65758382266693796
domContentLoaded--65257881666689792
domInteractive--251589182382
firstPaint--1076126745137206
backgroundConnect--245117273098
firstReactRender--16112941825
getState--311564144259
initialActions--104111
loadScripts--64957680865686790
setupStore--1264571230
numNetworkReqs--181276171269
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1295913216621114191654
load--7106151222100710954
domContentLoaded--6986111215100697945
domInteractive--39182002838102
firstPaint--1456447172169287
backgroundConnect--227278351833
firstReactRender--22164342328
getState--15312925423158198
initialActions--103111
loadScripts--695609120699695940
setupStore--211065112146
numNetworkReqs--1365231749159241
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15271191234320015991999
load--12231034202714213011469
domContentLoaded--12221033202714213011469
domInteractive--903328854115217
firstPaint--------
backgroundConnect--73222455398175
firstReactRender--14106361422
getState--147160171332
initialActions--103122
loadScripts--1176988189612612341375
setupStore--2555646314103
numNetworkReqs--201083181571
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--26251966644759626973830
load--12781023235730413152310
domContentLoaded--12781023235730413152309
domInteractive--2084712982592221218
firstPaint--------
backgroundConnect--321303220394510898
firstReactRender--21153642328
getState--22274764165256605
initialActions--208122
loadScripts--1231984228528912682206
setupStore--13513710147164544
numNetworkReqs--79331412592132
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16521334214417417392016
load--13841194177511314541603
domContentLoaded--13841193177511314541602
domInteractive--952921448131191
firstPaint--------
backgroundConnect--60202234171142
firstReactRender--15125341620
getState--208218301574
initialActions--113122
loadScripts--13511179165710114221533
setupStore--185233311383
numNetworkReqs--201080171571
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--27682072719063029193217
load--14901204586947015411819
domContentLoaded--14901204586847015411818
domInteractive--15348631101200318
firstPaint--------
backgroundConnect--3204734394213831007
firstReactRender--22155872530
getState--24470784185291687
initialActions--203123
loadScripts--14501182582946715101786
setupStore--14818816175154599
numNetworkReqs--83311762889146
19--------
📊 Page Load Benchmark Results

Current Commit: 4984401 | Date: 1/22/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±40ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 722ms (±38ms) 🟢 | historical mean value: 723ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 40ms 1.01s 1.34s 1.08s 1.34s
domContentLoaded 722ms 38ms 699ms 1.01s 758ms 1.01s
firstPaint 77ms 10ms 60ms 156ms 88ms 156ms
firstContentfulPaint 77ms 10ms 60ms 156ms 88ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 145 Bytes (0%)

Copy link
Copy Markdown
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

LGTM

@MajorLift MajorLift added this pull request to the merge queue Jan 23, 2026
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2026
…bal cascading re-renders (#39312)

## **Description**

`getPendingApprovals` was creating a new array on every call via
`Object.values()`, breaking memoization in the Routes component and
triggering cascade re-renders across ~50-60 child components on every
state change.

**Changes:**
- Wrapped `getPendingApprovals` in `createSelector` to memoize the
`Object.values()` transformation
- Added helper function `getPendingApprovalsObject` to extract the
pendingApprovals object
- Returns stable reference when underlying `pendingApprovals` object is
unchanged

**Implementation:**
```typescript
// Before: new array every call
export function getPendingApprovals(state: ApprovalsMetaMaskState) {
  return Object.values(state.metamask.pendingApprovals ?? {});
}

// After: memoized transformation
const getPendingApprovalsObject = (state: ApprovalsMetaMaskState) =>
  state.metamask.pendingApprovals ?? {};

export const getPendingApprovals = createSelector(
  getPendingApprovalsObject,
  (approvals) => Object.values(approvals),
);
```

**Testing:**
- Added unit tests verifying reference equality on repeated calls with
identical state
- Tests verify invalidation when pendingApprovals actually change
- All existing tests pass (664 selector tests across 31 suites)
- Covers edge cases (empty object, null/undefined values)

## **Changelog**

CHANGELOG entry: Fixed critical performance issue slowing down all user
actions by fixing approvals selector memoization

## **Related issues**

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6673
- Part of
[#6669](https://github.com/MetaMask/MetaMask-planning/issues/6669) —
Break Global Re-render Cascade

## **Manual testing steps**

1. Open MetaMask extension
2. Navigate to any page that triggers state changes (e.g., switching
networks, accounts)
3. Observe improved responsiveness compared to before (Routes component
and children no longer re-render unnecessarily)
4. Verify approvals functionality works correctly (no behavioral
changes)

## **Screenshots/Recordings**

### **Before**
N/A - Performance improvement (internal optimization, no UI changes)

### **After**
N/A - Performance improvement (internal optimization, no UI changes)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Optimizes approvals selectors to avoid unnecessary renders by
stabilizing outputs and handling empty/null states.
> 
> - Wraps `getPendingApprovals` with `createSelector` and adds
`getPendingApprovalsObject` using `EMPTY_OBJECT` fallback
> - Converts `pendingApprovalsSortedSelector` to a memoized selector
that sorts a copied array
> - Leaves existing APIs intact while returning stable references when
`pendingApprovals` is unchanged
> - Adds unit tests validating memoization, change invalidation, and
empty/null behavior
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4984401. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Jongsun Suh <jongsun.suh@icloud.com>
Merged via the queue into main with commit 352077c Jan 23, 2026
354 of 357 checks passed
@MajorLift MajorLift deleted the copilot/fix-get-pending-approvals-selector branch January 23, 2026 08:44
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
@metamaskbot metamaskbot added the release-13.16.0 Issue or pull request that will be included in release 13.16.0 label Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

external-contributor release-13.16.0 Issue or pull request that will be included in release 13.16.0 size-S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants