Skip to content

perf: Memoize ShieldSubscriptionProvider context value and callback#39309

Merged
MajorLift merged 9 commits intomainfrom
copilot/fix-shield-subscription-memoization
Mar 11, 2026
Merged

perf: Memoize ShieldSubscriptionProvider context value and callback#39309
MajorLift merged 9 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.

This is fix 6 of 6 in the P0 Global Cascade Re-render Fixes epic (RCA, Profiling Report). Together, the 6 memoization fixes break the cascade chain originating in Routes/Home that propagated through the entire component tree on every navigation and state update.

Open in GitHub Codespaces

Profiling Results (all 6 fixes combined -- Full Report)

We ran 7 rounds of controlled A/B benchmarks over 41 hours. Results confirm the cascade was the dominant source of interactive UI latency. WDYR audit: 0 cascade re-renders on treatment (RCA measured 125-200 per action on baseline).

Measured on test builds (yarn build:test) with React StrictMode, Power User persona (30 accounts). All p-values from Welch's t-test, confirmed by Mann-Whitney U. Effect sizes: Cohen's d = 0.93-5.11 (large to very large). n=5-20 per metric.

Per-interaction improvements

Flow Baseline Treatment Improvement p
Account switching (5 accts) 3.1s 1.7s -1.4s, 47% faster 0.044
Asset detail nav (ETH) 83ms 37ms -46ms, 55% faster 0.044
Asset detail nav (SOL) 75ms 31ms -44ms, 59% faster <0.001
Send flow (e2e) 928ms 804ms -124ms, 13% faster 0.044
Send: token select to form 25ms 13ms -12ms, 49% faster 0.040

Cascade compounding under sustained interaction

Route cycling benchmark (3 round-trips: Send -> Assets -> Swap):

Segment Baseline Treatment Improvement p
Total (6 transitions) 19.9s 2.7s -17.2s, 7x faster 0.004
sendToHome 6.4s 723ms -5.7s, 89% faster 0.018
assetDetailsToHome 6.3s 659ms -5.7s, 90% faster 0.004
swapToHome 5.0s 787ms -4.2s, 84% faster 0.001
homeToSwap 877ms 227ms -650ms, 74% faster 0.002
homeToAssetDetails 628ms 236ms -392ms, 62% faster 0.004
homeToSend 673ms 82ms -591ms, 88% faster 0.046

The 7x is a compounding effect across successive transitions, not a per-transition effect. Isolated transitions show only 10-15% improvement. Each navigation accumulates subscription/listener state on baseline, escalating re-render overhead -- consistent with the RCA's cascade chain model (Routes -> Home -> all children).

This compounding behavior is itself a key finding: it means any remaining or future cascade leak will degrade non-linearly with session length, even if it looks trivial in a single benchmark.

Production estimate: StrictMode roughly doubles render work. The 7x measured in dev builds is expected to land at ~2-7x in production depending on wallet size, tree depth, and GC timing.

Metrics to watch after merge

  • CI (metamask-performance): assetClickToPriceChart should show a step-change (83->37ms dev). cascadeFixProfiling preset can be added for ongoing regression tracking.
  • Production Sentry (RUM): Best signal at p75/p95 navigation latency and INP p95, segmented by users with 10+ accounts. Expect improvement on route transitions, account switching, token list rendering. Signal will be diffuse due to network variance and device heterogeneity -- don't expect a clean step-function.
  • TBT: Cascade generates clusters of consecutive long tasks (>50ms) on every state change. Fix eliminates these. Should show up in Sentry performance dashboard once long-task tracking is enabled.

Changelog

CHANGELOG entry: Fix memoization issue in top-level context provider that was causing cascading re-renders.

Related issues

Fixes: MetaMask/MetaMask-planning#6638

Part of epic: MetaMask-planning#6669 -- P0 Global Cascade Re-render Fixes

Sibling PRs:

Manual testing steps

Screenshots/Recordings

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
Changes how evaluateCohortEligibility is wired (ref-backed stable callback) and how the context value is memoized, which could alter when/with-what state eligibility checks run if the ref is not kept in sync. Added tests reduce risk but this touches subscription/cohort gating that affects modal display behavior.

Overview
Reduces cascading re-renders from ShieldSubscriptionProvider by making the exported evaluateCohortEligibility function reference-stable and memoizing the context value object.

Refactors evaluateCohortEligibility to delegate through a useRef-stored implementation (updated during render so it’s available in commit-phase callbacks) while keeping the public callback useCallback([]). Adds a new Jest test suite validating child rendering, stable callback/context identity across re-renders, and that the stable callback still observes updated selector values.

Written by Cursor Bugbot for commit 50a2fed. 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, +467 -136)
  • 📁 ui/
    • 📁 contexts/
      • 📁 shield/
        • 📄 shield-subscription.test.tsx +310 -0
        • 📄 shield-subscription.tsx +157 -136

@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
Copy link
Contributor

@MajorLift MajorLift left a comment

Choose a reason for hiding this comment

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

Notes for reviewers:

Comment on lines +301 to +311
/**
* Memoize the context value to prevent creating a new object reference
* on every render, which would cause unnecessary re-renders of consuming components.
*/
const contextValue = useMemo(
() => ({ evaluateCohortEligibility }),
[evaluateCohortEligibility],
);

return (
<ShieldSubscriptionContext.Provider
value={{
evaluateCohortEligibility,
}}
>
<ShieldSubscriptionContext.Provider value={contextValue}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Motivation for this PR: Memoize the context value

Comment on lines +276 to +280
const evaluateCohortEligibility = useCallback(
async (entrypointCohort: string): Promise<void> => {
await evaluateCohortEligibilityRef.current?.(entrypointCohort);
},
[
dispatch,
isMetaMaskShieldFeatureEnabled,
isBasicFunctionalityEnabled,
isShieldSubscriptionActive,
isSignedIn,
isUnlocked,
hasShieldEntryModalShownOnce,
getShieldSubscriptionEligibility,
assignToCohort,
captureShieldEligibilityCohortEvent,
],
[],
Copy link
Contributor

@MajorLift MajorLift Mar 5, 2026

Choose a reason for hiding this comment

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

Comment on lines +132 to +137
* Ref to hold the latest implementation of evaluateCohortEligibility.
* Assigned synchronously during render (not in useEffect) so the ref
* is populated before commit-phase callbacks (componentDidUpdate) fire.
*/
const evaluateCohortEligibility = useCallback(
async (entrypointCohort: string): Promise<void> => {
try {
if (!isMetaMaskShieldFeatureEnabled || !isBasicFunctionalityEnabled) {
return;
}
const evaluateCohortEligibilityRef =
useRef<(entrypointCohort: string) => Promise<void>>(null!);
Copy link
Contributor

Choose a reason for hiding this comment

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

Assigned synchronously at render time due to this edge case:

evaluateCohortEligibility now delegates to evaluateCohortEligibilityRef.current. If it's 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.
-- #39309 (comment)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 5, 2026

Builds ready [825e4ae]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28126929511289295
total28126929511289295
Confirm Txconfirm_tx608960846095560956095
total608960846095560956095
Bridge User Actionsbridge_load_page23520325819250258
bridge_load_asset_picker19214327447202274
bridge_search_token7127057164715716
total1112109811321311161132
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup15201231185112116191714
load12801044156511413571485
domContentLoaded12721041156111213501460
domInteractive3018119202773
firstPaint1607242477230259
backgroundConnect22720039321230251
firstReactRender21124962234
initialActions109123
loadScripts1064838135011211421262
setupStore1474671726
numNetworkReqs312287192282
Power User HomeuiStartup223813946866108621614536
load11761031162113412051528
domContentLoaded11611019159713311881515
domInteractive38192473134112
firstPaint1887938982261336
backgroundConnect59126041146884072205
firstReactRender24155982740
initialActions107113
loadScripts94879513461299581296
setupStore1654381735
numNetworkReqs67321542574126
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2212202221221222
srpButtonToSrpForm94939619396
confirmSrpToPwForm22212412324
pwFormToMetricsScreen16151701617
metricsToWalletReadyScreen16161701717
doneButtonToHomeScreen69460485299768852
openAccountMenuToAccountListLoaded2939290129763029762976
total39563733408512540434085
Onboarding New WalletcreateWalletToSocialScreen2182172201220220
srpButtonToPwForm1101061175116117
createPwToRecoveryScreen888088
skipBackupToMetricsScreen36353713637
agreeButtonToOnboardingSuccess16161601616
doneButtonToAssetList60749068576661685
total99788310717310461071
Asset DetailsassetClickToPriceChart1071061070107107
total1071061070107107
Solana Asset DetailsassetClickToPriceChart1101091121112112
total1101091121112112
Import Srp HomeloginToHomeScreen21271901249623523122496
openAccountMenuAfterLogin402951105051
homeAfterImportWithNewWallet262926182637826372637
total48114589519523949875195
Send TransactionsopenSendPageFromHome18171911819
selectTokenToSendFormLoaded19172322123
reviewTransactionToConfirmationPage8498458543849854
total8898848954891895
SwapopenSwapPageFromHome35353503535
fetchAndDisplaySwapQuotes268526832686126852686
total272027182722227222722
🌐 Dapp Page Load Benchmarks

Current Commit: 825e4ae | Date: 3/5/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

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

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 40ms 1.03s 1.35s 1.09s 1.35s
domContentLoaded 718ms 38ms 699ms 1.01s 758ms 1.01s
firstPaint 79ms 10ms 64ms 160ms 88ms 160ms
firstContentfulPaint 79ms 10ms 64ms 160ms 88ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 880.65 KiB (20.05%)
  • ui: 14.37 KiB (0.17%)
  • common: 60.37 KiB (0.54%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [3c72f0f]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account34432338124347381
total34432338124347381
Confirm Txconfirm_tx607860676084760836084
total607860676084760836084
Bridge User Actionsbridge_load_page23721827220248272
bridge_load_asset_picker1861851871187187
bridge_search_token7157017249723724
total1132110411652111401165
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14611239193811315291648
load12221017170211212771425
domContentLoaded12141012168311012721403
domInteractive3117133212680
firstPaint1587351390219365
backgroundConnect22020230517221251
firstReactRender20126882029
initialActions106114
loadScripts1012810147911010661206
setupStore1475471624
numNetworkReqs312289192283
Power User HomeuiStartup39801659130432734433912398
load13561091390739913291738
domContentLoaded13391074387239613221728
domInteractive3620207283559
firstPaint231841745175279343
backgroundConnect151828210611227412316447
firstReactRender27195372944
initialActions106114
loadScripts1103864359137610801432
setupStore1664272029
numNetworkReqs984524043104207
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202172232221223
srpButtonToSrpForm94949509595
confirmSrpToPwForm22212202222
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen16151711617
doneButtonToHomeScreen60559762612599626
openAccountMenuToAccountListLoaded2934290729782629432978
total3932387940085039764008
Onboarding New WalletcreateWalletToSocialScreen2192182222219222
srpButtonToPwForm1131041196119119
createPwToRecoveryScreen999099
skipBackupToMetricsScreen37353923939
agreeButtonToOnboardingSuccess17171801718
doneButtonToAssetList4974945024502502
total9368781069759691069
Asset DetailsassetClickToPriceChart11910213311126133
total11910213311126133
Solana Asset DetailsassetClickToPriceChart79768018080
total79768018080
Import Srp HomeloginToHomeScreen21421922245919522302459
openAccountMenuAfterLogin563882156482
homeAfterImportWithNewWallet26172506279210426762792
total48164718501311448745013
Send TransactionsopenSendPageFromHome302048103648
selectTokenToSendFormLoaded21202212222
reviewTransactionToConfirmationPage8548488605859860
total90488992815906928
SwapopenSwapPageFromHome41295394953
fetchAndDisplaySwapQuotes269126872695326952695
total273227242741627372741
🌐 Dapp Page Load Benchmarks

Current Commit: 3c72f0f | Date: 3/10/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±41ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 755ms (±39ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±12ms) 🟢 | historical mean value: 83ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 41ms 1.04s 1.38s 1.10s 1.38s
domContentLoaded 755ms 39ms 730ms 1.04s 779ms 1.04s
firstPaint 83ms 12ms 64ms 188ms 92ms 188ms
firstContentfulPaint 83ms 12ms 64ms 188ms 92ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 880.11 KiB (20.04%)
  • ui: 132.59 KiB (1.59%)
  • common: 64.16 KiB (0.57%)

@MajorLift MajorLift moved this from Needs dev review to Needs more work from the author in PR review queue Mar 10, 2026
@MajorLift MajorLift moved this from Needs more work from the author to Needs dev review in PR review queue Mar 10, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [ca53602]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account358265510114484510
total358265510114484510
Confirm Txconfirm_tx605960516068760616068
total605960516068760616068
Bridge User Actionsbridge_load_page2702632755274275
bridge_load_asset_picker19912325450252254
bridge_search_token74470877824760778
total1202110612715912481271
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup1385118316109614301575
load115898713929112131327
domContentLoaded115198113448812061317
domInteractive271793162475
firstPaint165691354140207265
backgroundConnect20818525614210240
firstReactRender19124762129
initialActions107124
loadScripts96079111528710191116
setupStore1363451522
numNetworkReqs322291192581
Power User HomeuiStartup2709155012137204923625952
load1145946186516911801535
domContentLoaded1129940184216811641517
domInteractive3518216283394
firstPaint1866948880236317
backgroundConnect826241968416954002676
firstReactRender23164662635
initialActions109113
loadScripts93475916151599781302
setupStore1554271627
numNetworkReqs863623350100207
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2172172170217217
srpButtonToSrpForm92899639396
confirmSrpToPwForm21212212122
pwFormToMetricsScreen14141401414
metricsToWalletReadyScreen15141501515
doneButtonToHomeScreen70367575532701755
openAccountMenuToAccountListLoaded249124862494424942494
total3631352637529737343752
Onboarding New WalletcreateWalletToSocialScreen2192172201220220
srpButtonToPwForm1081061091108109
createPwToRecoveryScreen889089
skipBackupToMetricsScreen36353713737
agreeButtonToOnboardingSuccess16161601616
doneButtonToAssetList629471828125700828
total1019860122512910971225
Asset DetailsassetClickToPriceChart12411113612134136
total12411113612134136
Solana Asset DetailsassetClickToPriceChart70617977479
total70617977479
Import Srp HomeloginToHomeScreen20281899219211020582192
openAccountMenuAfterLogin593878167078
homeAfterImportWithNewWallet26222509273410827262734
total46644487477510647714775
Send TransactionsopenSendPageFromHome21172842628
selectTokenToSendFormLoaded19181901919
reviewTransactionToConfirmationPage85684687211867872
total89688391813904918
SwapopenSwapPageFromHome33204394143
fetchAndDisplaySwapQuotes268826882689126882689
total272427142732627292732
🌐 Dapp Page Load Benchmarks

Current Commit: ca53602 | Date: 3/10/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±39ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 742ms (±37ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±11ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 39ms 1.02s 1.34s 1.08s 1.34s
domContentLoaded 742ms 37ms 716ms 1.02s 762ms 1.02s
firstPaint 81ms 11ms 64ms 172ms 92ms 172ms
firstContentfulPaint 81ms 11ms 64ms 172ms 92ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 880.11 KiB (20.04%)
  • ui: 132.63 KiB (1.59%)
  • common: 64.16 KiB (0.57%)

@MajorLift MajorLift requested a review from a team March 10, 2026 16:14
@sonarqubecloud
Copy link

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 10, 2026

Builds ready [50a2fed]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2692652754270275
total2692652754270275
Confirm Txconfirm_tx6083602161676361516167
total6083602161676361516167
Bridge User Actionsbridge_load_page21219822912215229
bridge_load_asset_picker18111625750201257
bridge_search_token7077057123707712
total1098106911231911021123
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14881248181111115251678
load12401023154510312811428
domContentLoaded12331017153910212761417
domInteractive281798192580
firstPaint1616945082225268
backgroundConnect21820125812221245
firstReactRender19134862132
initialActions108123
loadScripts1031815133010210801214
setupStore1373651624
numNetworkReqs362796183083
Power User HomeuiStartup34491804143852774287511540
load12861070316625413211685
domContentLoaded12681059315624913051652
domInteractive37172573730106
firstPaint23281536104290411
backgroundConnect11892671197124746076867
firstReactRender25175572836
initialActions104113
loadScripts1043848292124210561393
setupStore167101111726
numNetworkReqs1477727643168231
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2212192242222224
srpButtonToSrpForm98979809898
confirmSrpToPwForm23222302323
pwFormToMetricsScreen16161601616
metricsToWalletReadyScreen17171701717
doneButtonToHomeScreen5915885995592599
openAccountMenuToAccountListLoaded2932290929491629442949
total3902386939372639123937
Onboarding New WalletcreateWalletToSocialScreen2202172212221221
srpButtonToPwForm1101071163112116
createPwToRecoveryScreen889099
skipBackupToMetricsScreen36343813638
agreeButtonToOnboardingSuccess16161701617
doneButtonToAssetList589482757110680757
total981875116411510661164
Asset DetailsassetClickToPriceChart13110317026151170
total13110317026151170
Solana Asset DetailsassetClickToPriceChart79798018080
total79798018080
Import Srp HomeloginToHomeScreen22211933283833923352838
openAccountMenuAfterLogin524069126469
homeAfterImportWithNewWallet26632385304924528033049
total49364482552835250845528
Send TransactionsopenSendPageFromHome251543123643
selectTokenToSendFormLoaded22163052230
reviewTransactionToConfirmationPage9108471056868831056
total9558841120979281120
SwapopenSwapPageFromHome36294264142
fetchAndDisplaySwapQuotes268526832689226852689
total2738271527671927552767
🌐 Dapp Page Load Benchmarks

Current Commit: 50a2fed | Date: 3/10/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±42ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 734ms (±39ms) 🟢 | historical mean value: 729ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±12ms) 🟢 | historical mean value: 82ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 42ms 1.02s 1.35s 1.07s 1.35s
domContentLoaded 734ms 39ms 714ms 1.02s 755ms 1.02s
firstPaint 80ms 12ms 64ms 176ms 92ms 176ms
firstContentfulPaint 80ms 12ms 64ms 176ms 92ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.15 MiB (100%)
  • ui: 8.34 MiB (100%)
  • common: 10.99 MiB (100%)

@github-project-automation github-project-automation bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Mar 11, 2026
@MajorLift MajorLift added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 0d37542 Mar 11, 2026
184 checks passed
@MajorLift MajorLift deleted the copilot/fix-shield-subscription-memoization branch March 11, 2026 12:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.23.0 Issue or pull request that will be included in release 13.23.0 size-L team-extension-platform Extension Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants