Skip to content

Comments

perf: Memoize ShieldSubscriptionProvider context value and callback#39309

Open
Copilot wants to merge 3 commits intomainfrom
copilot/fix-shield-subscription-memoization
Open

perf: Memoize ShieldSubscriptionProvider context value and callback#39309
Copilot wants to merge 3 commits intomainfrom
copilot/fix-shield-subscription-memoization

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Description

ShieldSubscriptionProvider was creating a new context value object on every render and recreating evaluateCohortEligibility whenever any of its 10 dependencies changed, causing unnecessary re-renders of the Home component subtree.

Two fixes applied:

  1. Stabilized callback with ref pattern -- Moved the evaluateCohortEligibility implementation into a ref updated via useEffect. The public callback delegates to the ref, keeping a stable reference (useCallback with empty deps) while still accessing current closure values.

  2. Memoized context value -- Wrapped the provider value object in useMemo keyed on the now-stable callback, preventing a new object reference on every render.

Expected impact: ~60-70% reduction in re-renders for components consuming this context (Home page subtree).

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes: MetaMask/MetaMask-planning#6638

Manual testing steps

  1. Load the extension and navigate to the Home page.
  2. Open React DevTools Profiler and record a session while interacting with the Home page (switching tabs, scrolling, etc.).
  3. Verify that ShieldSubscriptionProvider consumers do not re-render unnecessarily -- the context value reference should remain stable across parent re-renders.
  4. Verify Shield subscription eligibility flows still work correctly (cohort assignment, entry modal display).

Screenshots/Recordings

Before

N/A -- no visual changes; this is a performance optimization.

After

N/A -- no visual changes; this is a performance optimization.

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

Medium Risk
Behavior should be equivalent, but ref-backed callbacks can hide stale/ordering bugs if the ref isn’t updated before consumers call it; changes affect Shield eligibility/modal flow triggers.

Overview
Improves ShieldSubscriptionProvider performance by making evaluateCohortEligibility and the provided context value stable across re-renders. The eligibility logic is moved into a ref updated via useEffect, while a zero-deps useCallback delegates to the ref so consumers don’t re-render when dependencies change.

Adds a Jest test suite covering child rendering, context shape, memoization/stable references, and that the stable callback still reads current selector values when conditions change.

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

Copilot AI changed the title [WIP] Fix memoization in Shield Subscription Provider Memoize ShieldSubscriptionProvider context value and callback Jan 16, 2026
Copilot AI requested a review from MajorLift January 16, 2026 04:52
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 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
Contributor

metamaskbotv2 bot commented Feb 9, 2026

✨ Files requiring CODEOWNER review ✨

🔐 @MetaMask/web3auth (2 files, +345 -31)
  • 📁 ui/
    • 📁 contexts/
      • 📁 shield/
        • 📄 shield-subscription.test.tsx +281 -0
        • 📄 shield-subscription.tsx +64 -31

@MajorLift MajorLift force-pushed the copilot/fix-shield-subscription-memoization branch from f6fdccb to 4f235d9 Compare February 9, 2026 17:54
@MajorLift MajorLift force-pushed the copilot/fix-shield-subscription-memoization branch from 4f235d9 to e6244fc Compare February 9, 2026 18:16
@MajorLift MajorLift force-pushed the copilot/fix-shield-subscription-memoization branch from e6244fc to aea7b5c Compare February 9, 2026 18:28
@MajorLift MajorLift removed their request for review February 9, 2026 18:29
@MajorLift MajorLift force-pushed the copilot/fix-shield-subscription-memoization branch from aea7b5c to a7e31e8 Compare February 10, 2026 12:18
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 10, 2026

Builds ready [a7e31e8]
UI Startup Metrics (1358 ± 89 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1358119215918914051517
load1179101613518212281333
domContentLoaded1173100913388212231327
domInteractive2815137222482
firstPaint162651221127206270
backgroundConnect24121830414248268
firstReactRender16103141822
initialActions107113
loadScripts9487821114829931101
setupStore1263241418
numNetworkReqs221586191580
BrowserifyPower User HomeuiStartup211113848466112520943780
load1162993188716512081553
domContentLoaded1144983178515811981543
domInteractive38181943135116
firstPaint231671818242256323
backgroundConnect49227627885183651901
firstReactRender22145362531
initialActions104112
loadScripts92176615261529641280
setupStore1575191632
numNetworkReqs1174126847146197
WebpackStandard HomeuiStartup84967312821209261035
load7316051204103796897
domContentLoaded7266011196102789891
domInteractive2616105182376
firstPaint1096238156136211
backgroundConnect27187492943
firstReactRender1493851621
initialActions104112
loadScripts7235991195101786889
setupStore1162541120
numNetworkReqs231586201581
WebpackPower User HomeuiStartup1192873240020412711493
load7216151497130705968
domContentLoaded7116091478130695960
domInteractive37181803135111
firstPaint158661491161172387
backgroundConnect15313029632155222
firstReactRender22174042428
initialActions102011
loadScripts7086071469128693952
setupStore1255161420
numNetworkReqs1324827649162234
FirefoxBrowserifyStandard HomeuiStartup15651336208315915881973
load13451151174312313811650
domContentLoaded13441151174312413771649
domInteractive76323164798138
firstPaint------
backgroundConnect56281702156102
firstReactRender12102421214
initialActions102122
loadScripts13191122170812013511621
setupStore167201241245
numNetworkReqs241290201783
BrowserifyPower User HomeuiStartup26551943364634128003316
load15041222218921315831995
domContentLoaded15031221218921315811995
domInteractive1233360199120321
firstPaint------
backgroundConnect3041251403255329886
firstReactRender18136691723
initialActions206122
loadScripts14661202214320815281954
setupStore1649818211216659
numNetworkReqs78391693298138
WebpackStandard HomeuiStartup16311358364423816541864
load14071186337722214471568
domContentLoaded14061181337722314471567
domInteractive913126850131191
firstPaint------
backgroundConnect57271912967109
firstReactRender16124861622
initialActions102122
loadScripts13791135334522014211537
setupStore146126151234
numNetworkReqs231384181874
WebpackPower User HomeuiStartup27391967815567128393562
load15921234639255516652218
domContentLoaded15911234639255516652218
domInteractive15633733156139522
firstPaint------
backgroundConnect3331221200257405892
firstReactRender22155872530
initialActions213122
loadScripts15351209635554216092019
setupStore1509743192147597
numNetworkReqs75351553294130
📊 Page Load Benchmark Results

Current Commit: a7e31e8 | Date: 2/10/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: 715ms (±36ms) 🟢 | historical mean value: 717ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±12ms) 🟢 | 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.06s 1.30s
domContentLoaded 715ms 36ms 695ms 974ms 745ms 974ms
firstPaint 76ms 12ms 56ms 180ms 84ms 180ms
firstContentfulPaint 76ms 12ms 56ms 180ms 84ms 180ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 171 Bytes (0%)
  • common: 20 Bytes (0%)

@MajorLift MajorLift force-pushed the copilot/fix-shield-subscription-memoization branch from a7e31e8 to 00f6e52 Compare February 10, 2026 20:26
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 10, 2026

Builds ready [00f6e52]
UI Startup Metrics (1341 ± 109 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup13411157194410913941500
load115097215319311901274
domContentLoaded114496915229311871266
domInteractive2515102182276
firstPaint176651179181205319
backgroundConnect23621740621237264
firstReactRender15103441620
initialActions104112
loadScripts9237571271879671049
setupStore1262541419
numNetworkReqs231588201583
BrowserifyPower User HomeuiStartup36941615115292364435410385
load12871114169412313231564
domContentLoaded12701099168211613021527
domInteractive3419144203283
firstPaint202831342144266349
backgroundConnect13612987500149618165012
firstReactRender24165952631
initialActions103112
loadScripts1018867142411010411255
setupStore1364351423
numNetworkReqs963815825110143
WebpackStandard HomeuiStartup85969311131039501035
load73761896996808904
domContentLoaded73261496395800899
domInteractive281691192577
firstPaint1136137758137219
backgroundConnect271773103043
firstReactRender15103251724
initialActions105112
loadScripts72961296194798890
setupStore1264651320
numNetworkReqs231594211584
WebpackPower User HomeuiStartup1350920286832714201939
load7756781106977771001
domContentLoaded763661109998763990
domInteractive40202233238123
firstPaint1657645883222296
backgroundConnect188133925126168455
firstReactRender23183532529
initialActions102011
loadScripts760659109096760980
setupStore1352551622
numNetworkReqs1418624432155209
FirefoxBrowserifyStandard HomeuiStartup15531321213916916091926
load13411143191213913961600
domContentLoaded13401143190713913951600
domInteractive73323004593137
firstPaint------
backgroundConnect5427166215585
firstReactRender12102321214
initialActions102012
loadScripts13161119188613513721563
setupStore13666101228
numNetworkReqs241295221786
BrowserifyPower User HomeuiStartup30152094908678632363859
load16741283630756317542190
domContentLoaded16741282630756417532190
domInteractive194571407178246434
firstPaint------
backgroundConnect49811814293467391183
firstReactRender19157281924
initialActions203122
loadScripts16231259625656016252145
setupStore15317753182157593
numNetworkReqs965218230117162
WebpackStandard HomeuiStartup15251255358525115471787
load13241144334522313561471
domContentLoaded13221143334422313561471
domInteractive773023141106139
firstPaint------
backgroundConnect48241632551100
firstReactRender13112521417
initialActions102012
loadScripts12981131331122013321438
setupStore166181261347
numNetworkReqs241392211682
WebpackPower User HomeuiStartup27712163365834129553458
load15191314249520215601888
domContentLoaded15191314249420215601888
domInteractive15449738117175360
firstPaint------
backgroundConnect48311518213246261105
firstReactRender22165772429
initialActions203122
loadScripts14711283246419614991855
setupStore134161002160141463
numNetworkReqs943721131103150
Benchmark value 10386 exceeds gate value 10000 for chrome browserify powerUserHome p95 uiStartup
Sum of mean exceeds: 0ms | Sum of p95 exceeds: 386ms
Sum of all benchmark exceeds: 386ms

📊 Page Load Benchmark Results

Current Commit: 00f6e52 | Date: 2/10/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±41ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 744ms (±38ms) 🟢 | historical mean value: 730ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±12ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 41ms 1.03s 1.36s 1.10s 1.36s
domContentLoaded 744ms 38ms 716ms 1.02s 779ms 1.02s
firstPaint 80ms 12ms 64ms 188ms 88ms 188ms
firstContentfulPaint 80ms 12ms 64ms 188ms 88ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 63 Bytes (0%)
  • ui: 3.91 KiB (0.05%)
  • common: 136.25 KiB (1.27%)

@MajorLift MajorLift changed the title Memoize ShieldSubscriptionProvider context value and callback perf: Memoize ShieldSubscriptionProvider context value and callback Feb 23, 2026
@MajorLift MajorLift added the team-extension-platform Extension Platform team label Feb 23, 2026
- Remove non-existent properties from `useSubscriptionEligibility` mock
- Cast `useSubscriptionMetrics` mock to match expected return type
- Use mutable ref object for `evaluateFn` to fix TS control flow narrowing
- Add `setPendingShieldCohort` to actions mock (from main)
@MajorLift MajorLift force-pushed the copilot/fix-shield-subscription-memoization branch from 9324916 to f3adfee Compare February 23, 2026 15:47
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 23, 2026

Builds ready [f3adfee]
⚡ Performance Benchmarks (1385 ± 125 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29042269363
total29042269363
Confirm Txconfirm_tx6026360296029
total6026360296029
Bridge User Actionsbridge_load_page24728273277
bridge_load_asset_picker19144211250
bridge_search_token73537763790
total11727112141274
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup13851169181812514411615
load1172970160711512291376
domContentLoaded1165961157611312191368
domInteractive2816113212380
firstPaint175681321145214377
backgroundConnect20418825213207231
firstReactRender19124952026
initialActions107113
loadScripts979778137411210331185
setupStore1363851522
numNetworkReqs312295202287
Chrome Browserify Startup Power User HomeuiStartup320515728243153739976394
load12281058178214712561604
domContentLoaded12111046176813912311557
domInteractive3419153253194
firstPaint212841585195257364
backgroundConnect1059264426596014123203
firstReactRender25185362638
initialActions104112
loadScripts1005849153713510351343
setupStore1566391731
numNetworkReqs84431532597130
Chrome Webpack Startup Standard HomeuiStartup85868911321059281067
load73761498698823877
domContentLoaded73161097896819869
domInteractive271593182374
firstPaint1086334553128200
backgroundConnect27185383042
firstReactRender18114262031
initialActions104112
loadScripts72860897695810866
setupStore1163041217
numNetworkReqs312294192584
Chrome Webpack Startup Power User HomeuiStartup1280857274929813361818
load7516341363106750981
domContentLoaded7406291354107741974
domInteractive40201703036113
firstPaint1457036471164315
backgroundConnect1841321166113170314
firstReactRender22165852329
initialActions102111
loadScripts7376281337105739965
setupStore1342851621
numNetworkReqs92491772598152
Firefox Browserify Startup Standard HomeuiStartup17401510262921817342216
load14621264224917514741824
domContentLoaded14601263224917514711823
domInteractive973535759132187
firstPaint------
backgroundConnect63331952663120
firstReactRender14122011516
initialActions103022
loadScripts14321238221717114451719
setupStore238183291967
numNetworkReqs3220101202789
Firefox Browserify Startup Power User HomeuiStartup29522134903188930133760
load16681313704574216561968
domContentLoaded16671313704574216561968
domInteractive14638558104159357
firstPaint------
backgroundConnect4548920083556551142
firstReactRender19156761925
initialActions207122
loadScripts16221291700173915951905
setupStore142191108178163617
numNetworkReqs873219037101172
Firefox Webpack Startup Standard HomeuiStartup17641443388239017392082
load14631254342122214961665
domContentLoaded14621254342122214961665
domInteractive118331922188133204
firstPaint------
backgroundConnect8228183717976129
firstReactRender16122831724
initialActions102122
loadScripts14331228339021914731619
setupStore45821482132289
numNetworkReqs311988172777
Firefox Webpack Startup Power User HomeuiStartup26611841539348528043295
load15501273372430215871951
domContentLoaded15501273372330215871950
domInteractive1405151090160335
firstPaint------
backgroundConnect3947018863245311046
firstReactRender19157362127
initialActions203122
loadScripts15131252368329315521823
setupStore149181014175165496
numNetworkReqs87282193999175
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2180218218
srpButtonToSrpForm9129194
confirmSrpToPwForm2102121
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1501515
doneButtonToHomeScreen61851603705
openAccountMenuToAccountListLoaded739870180228032
total851051489669097
Onboarding New WalletcreateWalletToSocialScreen2200220220
srpButtonToPwForm1123115117
createPwToRecoveryScreen9099
skipBackupToMetricsScreen3713839
agreeButtonToOnboardingSuccess1711818
doneButtonToAssetList88936611051497
total128436414961889
Asset DetailsassetClickToPriceChart3934044
total3934044
Solana Asset DetailsassetClickToPriceChart4924952
total4924952
Import Srp HomeloginToHomeScreen20024320082065
openAccountMenuAfterLogin4274851
homeAfterImportWithNewWallet238618124872625
total442719745164681
Send TransactionsopenSendPageFromHome25123939
selectTokenToSendFormLoaded27113743
reviewTransactionToConfirmationPage8484851852
total89412903907
SwapopenSwapPageFromHome12014130139
fetchAndDisplaySwapQuotes46667647284730
total47867548484866
🌐 Dapp Page Load Benchmarks

Current Commit: f3adfee | Date: 2/23/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±63ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 729ms (±60ms) 🟢 | historical mean value: 729ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±11ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 63ms 1.01s 1.32s 1.25s 1.32s
domContentLoaded 729ms 60ms 698ms 1.00s 928ms 1.00s
firstPaint 77ms 11ms 60ms 168ms 84ms 168ms
firstContentfulPaint 77ms 11ms 60ms 168ms 84ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 52.02 KiB (1.2%)
  • ui: -288 Bytes (0%)
  • common: 11.21 KiB (0.1%)

@MajorLift MajorLift marked this pull request as ready for review February 23, 2026 16:43
@MajorLift MajorLift requested a review from a team as a code owner February 23, 2026 16:43
Copy link

@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 1 potential issue.

assignToCohort,
captureShieldEligibilityCohortEvent,
],
[], // Empty deps = always stable!
Copy link

Choose a reason for hiding this comment

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

Callback can be no-op initially

High Severity

evaluateCohortEligibility now delegates to evaluateCohortEligibilityRef.current, which is only assigned inside a useEffect. Callers that invoke the callback during the commit phase (e.g., Home’s componentDidUpdate) can hit an uninitialized ref, making the call a silent no-op and potentially skipping Shield cohort evaluation permanently.

Fix in Cursor Fix in Web

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 23, 2026

Builds ready [c65e21b]
⚡ Performance Benchmarks (1340 ± 100 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28724308314
total28724308314
Confirm Txconfirm_tx60692360866100
total60692360866100
Bridge User Actionsbridge_load_page23422242271
bridge_load_asset_picker17420188202
bridge_search_token6983700700
total11021011101113
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup13401149180910013601526
load114697615189111691350
domContentLoaded113896415119011641329
domInteractive2715112192483
firstPaint183651184161214323
backgroundConnect20218626816204236
firstReactRender18133741923
initialActions1011113
loadScripts9547831326909791146
setupStore1262741518
numNetworkReqs312292202287
Chrome Browserify Startup Power User HomeuiStartup3241161710659196440168463
load12161051174411812551482
domContentLoaded11981036161810912261451
domInteractive3217158253097
firstPaint216761642170272336
backgroundConnect13362568230156321943240
firstReactRender23174152534
initialActions103112
loadScripts1002848142110610271232
setupStore15658101540
numNetworkReqs86441482093128
Chrome Webpack Startup Standard HomeuiStartup8427031116918921016
load72160696488771872
domContentLoaded71560295887766864
domInteractive2715117232388
firstPaint1105934655145215
backgroundConnect27184873141
firstReactRender18123862232
initialActions109113
loadScripts71360094986764862
setupStore1152741217
numNetworkReqs3222100202586
Chrome Webpack Startup Power User HomeuiStartup1298920288332113392047
load74965213021117341015
domContentLoaded73864512951117181007
domInteractive39181992938107
firstPaint1547352285185296
backgroundConnect2071321572176175404
firstReactRender22173732328
initialActions102111
loadScripts7356431285109715998
setupStore1354761521
numNetworkReqs984819630107160
Firefox Browserify Startup Standard HomeuiStartup16661429287024916562072
load14031202248721014161733
domContentLoaded14021202248620914161732
domInteractive69371573491139
firstPaint------
backgroundConnect65282383763144
firstReactRender14114941416
initialActions103122
loadScripts13731180239020013881708
setupStore218203341552
numNetworkReqs3220103212692
Firefox Browserify Startup Power User HomeuiStartup28922067776262130653563
load16281266598452016242000
domContentLoaded16281266598452016232000
domInteractive191491533227177489
firstPaint------
backgroundConnect4749912042976871028
firstReactRender211470121963
initialActions203122
loadScripts15881240594151615881953
setupStore13920873193132600
numNetworkReqs87362263796175
Firefox Webpack Startup Standard HomeuiStartup17241431316328017472010
load14511223285021814751617
domContentLoaded14501222285021814751617
domInteractive882923945129160
firstPaint------
backgroundConnect7425144014168114
firstReactRender16122531624
initialActions103122
loadScripts14241209282121314531583
setupStore197110201461
numNetworkReqs302090162768
Firefox Webpack Startup Power User HomeuiStartup28452186944473529843394
load15811353227519016372040
domContentLoaded15801353227419016372040
domInteractive15667723127149472
firstPaint------
backgroundConnect52010963306536381131
firstReactRender22166382331
initialActions217122
loadScripts15371335210818115871936
setupStore12819619135170424
numNetworkReqs873223238107156
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2190219219
srpButtonToSrpForm9319293
confirmSrpToPwForm2102222
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1721820
doneButtonToHomeScreen108032613071420
openAccountMenuToAccountListLoaded744143278668050
total888812789989037
Onboarding New WalletcreateWalletToSocialScreen2180218218
srpButtonToPwForm1061106106
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3513636
agreeButtonToOnboardingSuccess1601616
doneButtonToAssetList83426311361173
total121826515231562
Asset DetailsassetClickToPriceChart59147276
total59147276
Solana Asset DetailsassetClickToPriceChart4925051
total4925051
Import Srp HomeloginToHomeScreen20759721152233
openAccountMenuAfterLogin4194256
homeAfterImportWithNewWallet250421427482752
total461929449095037
Send TransactionsopenSendPageFromHome28123349
selectTokenToSendFormLoaded2032025
reviewTransactionToConfirmationPage8492851852
total9023904904
SwapopenSwapPageFromHome9179699
fetchAndDisplaySwapQuotes46847147334763
total47627048174862
🌐 Dapp Page Load Benchmarks

Current Commit: c65e21b | Date: 2/23/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±39ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 740ms (±36ms) 🟢 | historical mean value: 735ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±11ms) 🟢 | historical mean value: 79ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 39ms 1.03s 1.33s 1.09s 1.33s
domContentLoaded 740ms 36ms 717ms 992ms 771ms 992ms
firstPaint 80ms 11ms 64ms 180ms 88ms 180ms
firstContentfulPaint 80ms 11ms 64ms 180ms 88ms 180ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 176 Bytes (0%)
  • common: 20 Bytes (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-M team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants