Skip to content

Comments

perf: add Long Task detection and TBT calculation#39715

Open
MajorLift wants to merge 5 commits intomainfrom
jongsun/perf/260202-tbt-longtask
Open

perf: add Long Task detection and TBT calculation#39715
MajorLift wants to merge 5 commits intomainfrom
jongsun/perf/260202-tbt-longtask

Conversation

@MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Feb 2, 2026

Summary

Add performance observer utilities for Core Web Vitals measurement:

  • setupLongTaskObserver(): Observes main thread blocking >50ms with 10% sampling
  • calculateTBT(): Derives Total Blocking Time from Long Task entries
  • getTBTRating(): Returns Lighthouse-based rating (good/needs-improvement/poor)
  • reportLongTaskMetricsToSentry(): Reports metrics to Sentry traces with breadcrumbs

Motivation

Power users with large token lists and many accounts experience significantly more Long Tasks, causing UI jank. This instrumentation provides visibility into main thread blocking to:

  1. Detect performance regressions before users complain
  2. Correlate TBT with wallet size for targeted optimization
  3. Establish quality gate thresholds

Example Output

Long Task Metrics (per run)

{
  "longTaskMetrics": {
    "count": 12,
    "totalDuration": 847,
    "maxDuration": 156,
    "tbt": 247,
    "tbtRating": "needs-improvement"
  }
}

Benchmark Summary (aggregated)

Page: home
  pageLoadTime:           mean=1234ms  p95=1456ms  p99=1589ms
  domContentLoaded:       mean=456ms   p95=523ms   p99=567ms
  firstContentfulPaint:   mean=234ms   p95=289ms   p99=312ms
  largestContentfulPaint: mean=567ms   p95=678ms   p99=723ms
  longTaskMetrics.count:  mean=8       p95=15      p99=22
  longTaskMetrics.tbt:    mean=189ms   p95=345ms   p99=456ms

TBT Thresholds (Lighthouse-based)

Rating TBT Range
Good < 200ms
Needs Improvement 200-600ms
Poor > 600ms

Test plan

  • Unit tests pass: yarn test:unit ui/helpers/utils/performance-observers.test.ts
  • Verify observer initializes in sampled sessions
  • Verify metrics reported to Sentry in production builds

Related

Resolves: MetaMask/MetaMask-planning#6734
Related epic: MetaMask/MetaMask-planning#6741

CHANGELOG entry

CHANGELOG entry: None - Internal performance instrumentation only

return '6-10';
}
if (count <= 25) {
return '25-25';
Copy link

Choose a reason for hiding this comment

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

Typo in bucket label returns incorrect value

Medium Severity

The bucketizeCount function returns '25-25' for counts in the 11-25 range, but this appears to be a typo. The expected bucket label following the pattern ('0', '1-5', '6-10', then '26-50', '50+') is '11-25'. This will cause incorrect Sentry tag filtering as the bucket label is nonsensical.

Fix in Cursor Fix in Web

observer.observe({ type: 'longtask', buffered: true });
} catch (error) {
console.warn('[Performance] Failed to setup Long Task observer:', error);
}
Copy link

Choose a reason for hiding this comment

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

Failed observe() leaves observer in broken state

Medium Severity

If observer.observe() throws (e.g., on Firefox/Safari where longtask entry type isn't supported), the observer variable remains set from the successful new PerformanceObserver() call. The catch block logs a warning but doesn't reset observer to null. On subsequent calls, the if (observer) guard at line 89 returns early, thinking observation is already active. This silently prevents any future retry attempts and no metrics are ever collected on unsupported browsers.

Fix in Cursor Fix in Web

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 2, 2026

Builds ready [235440d]
UI Startup Metrics (1362 ± 103 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--13621155172210314161517
load--1174963151010012251312
domContentLoaded--1166960150110012171302
domInteractive--2815173242479
firstPaint--167641203125204300
backgroundConnect--22820927414231259
firstReactRender--16103541823
initialActions--105112
loadScripts--955751127410010131099
setupStore--1162851420
numNetworkReqs--221578171575
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--19701577242715320682230
load--11321014169314311251522
domContentLoaded--1117994167914211131516
domInteractive--37191832935112
firstPaint--197771528157237407
backgroundConnect--31828245233329389
firstReactRender--25166092647
initialActions--105113
loadScripts--88177213741278701241
setupStore--1675181730
numNetworkReqs--1245124752149239
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--805649103193871977
load--66356590582735840
domContentLoaded--65856089881730834
domInteractive--241588172073
firstPaint--1105736154142222
backgroundConnect--41151272952101
firstReactRender--15103541624
initialActions--103111
loadScripts--65555889680726832
setupStore--1072631118
numNetworkReqs--221588181577
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1252863221424714091698
load--71162613031227041047
domContentLoaded--70161812951226921042
domInteractive--37181743534156
firstPaint--158671001133169474
backgroundConnect--16612943760161329
firstReactRender--22153732429
initialActions--102111
loadScripts--69961612861206901034
setupStore--1151831417
numNetworkReqs--1275025857157248
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15931332208115717171890
load--13381153175212014181529
domContentLoaded--13371153174812014121529
domInteractive--76332324296146
firstPaint--------
backgroundConnect--68291833870151
firstReactRender--1293441318
initialActions--102122
loadScripts--13001130162810813691501
setupStore--144173211246
numNetworkReqs--231287181877
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--29822250484658531084383
load--15841258260632416732412
domContentLoaded--15831257260132416702411
domInteractive--1123748189115354
firstPaint--------
backgroundConnect--2471091075182270844
firstReactRender--18146562027
initialActions--103122
loadScripts--15371233244229116292329
setupStore--1327734188121610
numNetworkReqs--71372004392183
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--17001436218615417791996
load--14631225182012215361725
domContentLoaded--14631225182012215361725
domInteractive--903134250130155
firstPaint--------
backgroundConnect--65252074167161
firstReactRender--15114741623
initialActions--103122
loadScripts--14251211173810914841646
setupStore--196218341294
numNetworkReqs--231284171876
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--30702238904678032304047
load--16751303674659717352395
domContentLoaded--16741303674559717352394
domInteractive--12933814146109570
firstPaint--------
backgroundConnect--30911616392883161028
firstReactRender--22166872334
initialActions--203123
loadScripts--16151225671358516922253
setupStore--16561264239181743
numNetworkReqs--70372004487186
19--------
📊 Page Load Benchmark Results

Current Commit: 235440d | Date: 2/2/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±39ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 731ms (±35ms) 🟢 | historical mean value: 712ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±12ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 39ms 1.03s 1.34s 1.06s 1.34s
domContentLoaded 731ms 35ms 714ms 992ms 741ms 992ms
firstPaint 79ms 12ms 60ms 192ms 84ms 192ms
firstContentfulPaint 79ms 12ms 60ms 192ms 84ms 192ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 2.52 KiB (0.03%)
  • common: 20 Bytes (0%)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 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.

@MajorLift MajorLift requested a review from a team as a code owner February 2, 2026 23:35
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 2, 2026

✨ Files requiring CODEOWNER review ✨

🧪 @MetaMask/qa (1 files, +58 -10)
  • 📁 test/
    • 📁 e2e/
      • 📁 page-objects/
        • 📁 benchmark/
          • 📄 page-load-benchmark.ts +58 -10

👨‍🔧 @MetaMask/wallet-integrations (1 files, +58 -10)
  • 📁 test/
    • 📁 e2e/
      • 📁 page-objects/
        • 📁 benchmark/
          • 📄 page-load-benchmark.ts +58 -10

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.

@MajorLift MajorLift marked this pull request as draft February 3, 2026 00:14
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 3, 2026

Builds ready [8c12157]
UI Startup Metrics (1375 ± 84 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--1375115115838414351510
load--118399013678212391311
domContentLoaded--117696413608412311307
domInteractive--261697182472
firstPaint--182661235194205283
backgroundConnect--23721528714246264
firstReactRender--1793342024
initialActions--107113
loadScripts--95675511368310091085
setupStore--1263451422
numNetworkReqs--211586161568
longTaskCount--000000
longTaskTotalDuration--000000
longTaskMaxDuration--000000
tbt--000000
lcp--000000
cls--000000
inp--000000
inpEventCount--000000
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--278716608378137030155127
load--12061039181314712571559
domContentLoaded--11861023179414412391532
domInteractive--40184214635122
firstPaint--217811070129266381
backgroundConnect--74828433977786792753
firstReactRender--25176072639
initialActions--104112
loadScripts--948799149113010021230
setupStore--1576381731
numNetworkReqs--995227143109197
longTaskCount--000000
longTaskTotalDuration--000000
longTaskMaxDuration--000000
tbt--000000
lcp--000000
cls--000000
inp--000000
inpEventCount--000000
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--83966911231069141058
load--708594103898783900
domContentLoaded--702590102997773893
domInteractive--241589172173
firstPaint--1205861176148272
backgroundConnect--3416158214178
firstReactRender--15104361627
initialActions--107113
loadScripts--699588102896767891
setupStore--1163451123
numNetworkReqs--221583191580
longTaskCount--000000
longTaskTotalDuration--000000
longTaskMaxDuration--000000
tbt--000000
lcp--000000
cls--000000
inp--000000
inpEventCount--000000
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--1301893226927114921760
load--74364310781047341032
domContentLoaded--73063510731057251025
domInteractive--39201972738106
firstPaint--1617353498196397
backgroundConnect--16413537444167292
firstReactRender--24196252635
initialActions--104111
loadScripts--72763310651037221015
setupStore--1252441620
numNetworkReqs--1645735059178311
longTaskCount--000000
longTaskTotalDuration--000000
longTaskMaxDuration--000000
tbt--000000
lcp--000000
cls--000000
inp--000000
inpEventCount--000000
19--------
FirefoxBrowserifyStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--16571316219219518011990
load--13991164180516415201707
domContentLoaded--13981164179716415191706
domInteractive--78342093999149
firstPaint--------
backgroundConnect--782722047118168
firstReactRender--1291911214
initialActions--103112
loadScripts--13551141177914414511621
setupStore--153174221259
numNetworkReqs--231285181878
longTaskCount--000000
longTaskTotalDuration--000000
longTaskMaxDuration--000000
tbt--000000
lcp--000000
cls--000000
inp--000000
inpEventCount--000000
19--------
BrowserifyPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--31022323880672132853998
load--16701338728763216992467
domContentLoaded--16701338728763216992467
domInteractive--154421305156155418
firstPaint--------
backgroundConnect--42711215263156441152
firstReactRender--19146461927
initialActions--203123
loadScripts--16261312725462816262404
setupStore--1249821154144482
numNetworkReqs--89402484798215
longTaskCount--000000
longTaskTotalDuration--000000
longTaskMaxDuration--000000
tbt--000000
lcp--000000
cls--000000
inp--000000
inpEventCount--000000
19--------
WebpackStandard Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--15851269220617516891916
load--13641153178712314381575
domContentLoaded--13631153178712314381575
domInteractive--742716338105143
firstPaint--------
backgroundConnect--57232033568133
firstReactRender--14104861419
initialActions--103012
loadScripts--13341132173211413931551
setupStore--146165211247
numNetworkReqs--231285181877
longTaskCount--000000
longTaskTotalDuration--000000
longTaskMaxDuration--000000
tbt--000000
lcp--000000
cls--000000
inp--000000
inpEventCount--000000
19--------
WebpackPower User Home0--------
1--------
2--------
3--------
4--------
5--------
6--------
7--------
8--------
9--------
10--------
11--------
12--------
13--------
14--------
15--------
16--------
17--------
18--------
uiStartup--30422047817376932054193
load--16701257634463817262591
domContentLoaded--16701257634463817252590
domInteractive--14235679124147461
firstPaint--------
backgroundConnect--3951161572278563993
firstReactRender--21157072330
initialActions--203123
loadScripts--16281245629663116882522
setupStore--1598778196214690
numNetworkReqs--87402654991213
longTaskCount--000000
longTaskTotalDuration--000000
longTaskMaxDuration--000000
tbt--000000
lcp--000000
cls--000000
inp--000000
inpEventCount--000000
19--------
📊 Page Load Benchmark Results

Current Commit: 8c12157 | Date: 2/3/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±39ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 717ms (±36ms) 🟢 | historical mean value: 712ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±14ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 39ms 1.01s 1.32s 1.05s 1.32s
domContentLoaded 717ms 36ms 697ms 993ms 725ms 993ms
firstPaint 76ms 14ms 56ms 196ms 84ms 196ms
firstContentfulPaint 76ms 14ms 56ms 196ms 84ms 196ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 202 Bytes (0%)
  • common: 20 Bytes (0%)

@MajorLift MajorLift force-pushed the jongsun/perf/260202-tbt-longtask branch from 82df629 to b2cee13 Compare February 6, 2026 22:02
MajorLift and others added 2 commits February 6, 2026 17:12
`PerformanceObserver` for `longtask` entries is supported on
`chrome-extension://` pages, unlike paint-based metrics (LCP, FCP).

- `setupLongTaskObserver` with configurable sample rate
- `calculateTBT` / `getTBTRating` based on Lighthouse thresholds
- `reportLongTaskMetricsToSentry` for production instrumentation
- `exposeLongTaskMetricsForTesting` for E2E stateHooks access
- Add `LongTaskMetrics` / `LongTaskMetricsWithTBT` to `global.d.ts`

Co-authored-by: Cursor <cursoragent@cursor.com>
Collect `getLongTaskMetricsWithTBT()` from stateHooks in
`PageLoadBenchmark.collectMetrics()`. Add `longTaskCount`,
`longTaskTotalDuration`, `longTaskMaxDuration`, `tbt` to
benchmark constants.

Co-authored-by: Cursor <cursoragent@cursor.com>
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 6, 2026

Builds ready [c468f35]
UI Startup Metrics (1422 ± 110 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup14221231182411014831569
load1217986152910512861376
domContentLoaded1211981152410512811369
domInteractive2716118212482
firstPaint1446235670198264
backgroundConnect24022130917241277
firstReactRender17103551827
initialActions107114
loadScripts987768130310710561149
setupStore1365161622
numNetworkReqs231589201581
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
BrowserifyPower User HomeuiStartup2238136310543135721634321
load12101026223019812691631
domContentLoaded11961020222119512441597
domInteractive3418165253289
firstPaint212761777236246337
backgroundConnect669281568710413852500
firstReactRender22154862334
initialActions104112
loadScripts95579018961819801340
setupStore1474261529
numNetworkReqs1195026045138202
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
WebpackStandard HomeuiStartup814669115987860981
load68458598981744819
domContentLoaded68058198480740813
domInteractive251598192082
firstPaint1035831948131185
backgroundConnect39171442939112
firstReactRender15103051724
initialActions105112
loadScripts67758097479738804
setupStore1163241120
numNetworkReqs231590211586
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
WebpackPower User HomeuiStartup1251882225422613551653
load73562111931267311053
domContentLoaded72461511531257161045
domInteractive39182293435113
firstPaint16065585108196454
backgroundConnect16413140555154317
firstReactRender22173742329
initialActions102111
loadScripts72161311271237131037
setupStore1252341419
numNetworkReqs1406028149157264
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
FirefoxBrowserifyStandard HomeuiStartup16671317233021917482084
load14031146208617314941733
domContentLoaded14021145207817314941732
domInteractive74333294696138
firstPaint------
backgroundConnect72272694775170
firstReactRender13101821416
initialActions103122
loadScripts13661123205615914501666
setupStore146126181236
numNetworkReqs241195211883
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
BrowserifyPower User HomeuiStartup26951999713159328143422
load15071222579446915611886
domContentLoaded15061222579346915601881
domInteractive13334535106133373
firstPaint------
backgroundConnect39911613963005991002
firstReactRender18146391726
initialActions103123
loadScripts14631196576146414971738
setupStore12971212199123559
numNetworkReqs77391883293142
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
WebpackStandard HomeuiStartup16131275212316617071898
load13711159181211514311543
domContentLoaded13701159181211514311542
domInteractive863023245120144
firstPaint------
backgroundConnect68212664693158
firstReactRender1611135151521
initialActions103122
loadScripts13321144179110713931493
setupStore226226351596
numNetworkReqs241291201881
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
WebpackPower User HomeuiStartup27501948827770128333489
load15631191658656216791995
domContentLoaded15621191658656216791995
domInteractive14531716145130497
firstPaint------
backgroundConnect3411181308270388888
firstReactRender21147172329
initialActions203123
loadScripts15221170652355116251939
setupStore1657917218189659
numNetworkReqs75371853491140
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
📊 Page Load Benchmark Results

Current Commit: c468f35 | Date: 2/6/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±37ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 711ms (±35ms) 🟢 | historical mean value: 731ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±9ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 37ms 999ms 1.29s 1.06s 1.29s
domContentLoaded 711ms 35ms 690ms 968ms 745ms 968ms
firstPaint 75ms 9ms 60ms 152ms 84ms 152ms
firstContentfulPaint 75ms 9ms 60ms 152ms 84ms 152ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 20 Bytes (0%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 23, 2026

Builds ready [352c993]
⚡ Performance Benchmarks (1410 ± 115 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account27111277286
total27111277286
Confirm Txconfirm_tx60901660976112
total60901660976112
Bridge User Actionsbridge_load_page2362235239
bridge_load_asset_picker1645169171
bridge_search_token7024702708
total1105111071107
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup14101172186811514451620
load118399515239712211357
domContentLoaded117698315159612161348
domInteractive2917115222493
firstPaint164691204157210275
backgroundConnect20718724412212235
firstReactRender19144142126
initialActions107123
loadScripts98579413139610251160
setupStore1475261620
numNetworkReqs312298202288
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Chrome Browserify Startup Power User HomeuiStartup297614119862166237625169
load12381068169812512891509
domContentLoaded12201046168512212601486
domInteractive3618265333494
firstPaint239831702219278404
backgroundConnect9012607650107810442919
firstReactRender23165252530
initialActions103111
loadScripts1013846143511610581252
setupStore1464661524
numNetworkReqs84431532499124
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Chrome Webpack Startup Standard HomeuiStartup91271013691089711078
load776630108799851930
domContentLoaded770623107999845923
domInteractive3016149252489
firstPaint1166334362137243
backgroundConnect27185683240
firstReactRender19134062332
initialActions106112
loadScripts767621107098839917
setupStore1363661424
numNetworkReqs312293192584
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Chrome Webpack Startup Power User HomeuiStartup1286903288433413211934
load74263011071027461001
domContentLoaded7306231095102731966
domInteractive38201712836108
firstPaint1497151381178292
backgroundConnect2041291302173169481
firstReactRender22166762328
initialActions102011
loadScripts727621108699728950
setupStore1354061521
numNetworkReqs1304222142153211
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Browserify Startup Standard HomeuiStartup16511401268421016552082
load13961174244317214041612
domContentLoaded13951174243717214031612
domInteractive913542557118169
firstPaint------
backgroundConnect60282803759103
firstReactRender14114841416
initialActions103112
loadScripts13671148241616413911538
setupStore177139211447
numNetworkReqs3221101212793
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Browserify Startup Power User HomeuiStartup27622005892470228753378
load15721287680357115751889
domContentLoaded15721287680357115751889
domInteractive156481388158179357
firstPaint------
backgroundConnect3471141888288478811
firstReactRender19145981826
initialActions103122
loadScripts15341260655655015481861
setupStore161121497225154594
numNetworkReqs86362013698171
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Webpack Startup Standard HomeuiStartup17351452327827217372162
load14641226300724814731592
domContentLoaded14641225300724814731592
domInteractive126291604202131185
firstPaint------
backgroundConnect58272123258116
firstReactRender16122831724
initialActions103122
loadScripts14421204299024714481557
setupStore227174261763
numNetworkReqs301984162771
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Webpack Startup Power User HomeuiStartup27782215776360729433417
load16021343653552116071998
domContentLoaded16021343653552116071998
domInteractive15646691118176393
firstPaint------
backgroundConnect4231151499313599984
firstReactRender21165672329
initialActions2027323
loadScripts15621303650251715861914
setupStore15418713178141593
numNetworkReqs84332153789176
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2191220220
srpButtonToSrpForm9249498
confirmSrpToPwForm2222425
pwFormToMetricsScreen1511516
metricsToWalletReadyScreen1601616
doneButtonToHomeScreen136114014141564
openAccountMenuToAccountListLoaded681543672167248
total839051888929142
Onboarding New WalletcreateWalletToSocialScreen2182220220
srpButtonToPwForm1061108108
createPwToRecoveryScreen8089
skipBackupToMetricsScreen3513536
agreeButtonToOnboardingSuccess1611617
doneButtonToAssetList52151510607
total90648889987
Asset DetailsassetClickToPriceChart3723940
total3723940
Solana Asset DetailsassetClickToPriceChart4814950
total4814950
Import Srp HomeloginToHomeScreen19931920202020
openAccountMenuAfterLogin4275052
homeAfterImportWithNewWallet24473624842484
total462218147304861
Send TransactionsopenSendPageFromHome2593439
selectTokenToSendFormLoaded1921921
reviewTransactionToConfirmationPage85911870872
total90519914933
SwapopenSwapPageFromHome11712128132
fetchAndDisplaySwapQuotes46696347294734
total47825848294851
🌐 Dapp Page Load Benchmarks

Current Commit: 352c993 | Date: 2/23/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 994ms (±38ms) 🟢 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 687ms (±35ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 994ms 38ms 968ms 1.28s 1.01s 1.28s
domContentLoaded 687ms 35ms 668ms 946ms 699ms 946ms
firstPaint 77ms 10ms 64ms 160ms 88ms 160ms
firstContentfulPaint 77ms 10ms 64ms 160ms 88ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 280.26 KiB (6.9%)
  • ui: 102.59 KiB (1.25%)
  • common: 456.8 KiB (4.26%)

@MajorLift MajorLift force-pushed the jongsun/perf/260202-tbt-longtask branch from 352c993 to b1b106f Compare February 23, 2026 15:53
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Feb 23, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 23, 2026

Builds ready [b1b106f]
⚡ Performance Benchmarks (1456 ± 100 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account26510261282
total26510261282
Confirm Txconfirm_tx6058660616065
total6058660616065
Bridge User Actionsbridge_load_page2057211216
bridge_load_asset_picker2058210218
bridge_search_token70914720729
total11192411421149
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup14561234174610014931660
load1222101614158412661372
domContentLoaded1215101214098412591368
domInteractive2917121192580
firstPaint166691272139219350
backgroundConnect21319827615213246
firstReactRender19135152124
initialActions108114
loadScripts101881312238510611172
setupStore1373661623
numNetworkReqs312293202386
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Chrome Browserify Startup Power User HomeuiStartup2621151210897177823444781
load12271077178014512671624
domContentLoaded12101066171613812501601
domInteractive3520145193563
firstPaint195751621170253346
backgroundConnect75726048709644922625
firstReactRender25165262738
initialActions104112
loadScripts997845149713410411376
setupStore17756101938
numNetworkReqs74361632688118
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Chrome Webpack Startup Standard HomeuiStartup91072414461079651097
load768638112597834918
domContentLoaded762634111997829910
domInteractive3016136252598
firstPaint1276638966176248
backgroundConnect29196793344
firstReactRender19134672234
initialActions104112
loadScripts759632111096827903
setupStore1354861424
numNetworkReqs312291202584
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Chrome Webpack Startup Power User HomeuiStartup1279957259223413161702
load75364811331067501025
domContentLoaded74164111241077421018
domInteractive39191562738104
firstPaint1516944576173297
backgroundConnect1971321304142174349
firstReactRender23173332529
initialActions102011
loadScripts73863911161067391010
setupStore1354571524
numNetworkReqs1234325144147209
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Browserify Startup Standard HomeuiStartup16331384265422616881993
load13811177239119714401686
domContentLoaded13801177238719714391683
domInteractive73334346387171
firstPaint------
backgroundConnect56251832660108
firstReactRender13112221416
initialActions102012
loadScripts13531152236819014111601
setupStore217247351470
numNetworkReqs311996202590
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Browserify Startup Power User HomeuiStartup28282009962488128423649
load16491252701171415922342
domContentLoaded16481252701071415922342
domInteractive13534637120121422
firstPaint------
backgroundConnect3111151274270343939
firstReactRender18157171823
initialActions103122
loadScripts16101233696170915412317
setupStore1608837212186694
numNetworkReqs66292354081143
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Webpack Startup Standard HomeuiStartup18391453350831418652144
load15341299305124215771791
domContentLoaded15341299305124215771791
domInteractive109311547152133176
firstPaint------
backgroundConnect8729158015673182
firstReactRender17136361726
initialActions103122
loadScripts15051277301423715441752
setupStore238127212465
numNetworkReqs312092182779
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Webpack Startup Power User HomeuiStartup29352030875974330593821
load17241351719662317442274
domContentLoaded17231351719562317432274
domInteractive172331477213138704
firstPaint------
backgroundConnect3701251199282504974
firstReactRender23176962530
initialActions213123
loadScripts16781329712061317102243
setupStore18211808206307599
numNetworkReqs69282244577186
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2181219219
srpButtonToSrpForm9229397
confirmSrpToPwForm2102121
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1601717
doneButtonToHomeScreen64479651770
openAccountMenuToAccountListLoaded747645378457854
total87711187858785
Onboarding New WalletcreateWalletToSocialScreen2202222223
srpButtonToPwForm1081109109
createPwToRecoveryScreen9099
skipBackupToMetricsScreen3723840
agreeButtonToOnboardingSuccess1711818
doneButtonToAssetList7932769571184
total118627813621573
Asset DetailsassetClickToPriceChart59257995
total59257995
Solana Asset DetailsassetClickToPriceChart5916060
total5916060
Import Srp HomeloginToHomeScreen19766620282080
openAccountMenuAfterLogin3803838
homeAfterImportWithNewWallet247313225912591
total465135246535206
Send TransactionsopenSendPageFromHome2012121
selectTokenToSendFormLoaded2112223
reviewTransactionToConfirmationPage85611854874
total90311912915
SwapopenSwapPageFromHome12614127146
fetchAndDisplaySwapQuotes46256746114739
total47386447224847
🌐 Dapp Page Load Benchmarks

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

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.09s (±54ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 757ms (±52ms) 🟢 | historical mean value: 729ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±11ms) 🟢 | historical mean value: 80ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.09s 54ms 1.04s 1.39s 1.12s 1.39s
domContentLoaded 757ms 52ms 718ms 1.06s 787ms 1.06s
firstPaint 81ms 11ms 64ms 176ms 88ms 176ms
firstContentfulPaint 81ms 11ms 64ms 176ms 88ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 332.22 KiB (8.18%)
  • ui: 102.14 KiB (1.24%)
  • common: 467.99 KiB (4.37%)

- Use `type` instead of `interface` per ESLint rules
- Use `T[]` instead of `Array<T>` per array-type rule
- Fix Prettier formatting on `setMeasurement` call
- Add missing JSDoc `@param` for `bucketizeCount` function
Add `NumericBenchmarkMetrics` type that excludes object-typed properties
(`memoryUsage`, `longTaskMetrics`) for statistical aggregation. Update
`BenchmarkSummary` to use this type for mean/min/max/p95/p99/stddev fields.
@MajorLift MajorLift force-pushed the jongsun/perf/260202-tbt-longtask branch from 059ee1c to d804821 Compare February 23, 2026 16:51
@MajorLift MajorLift marked this pull request as ready for review February 23, 2026 17:00
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 23, 2026

Builds ready [d804821]
⚡ Performance Benchmarks (1385 ± 112 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2699273281
total2699273281
Confirm Txconfirm_tx60261360336046
total60261360336046
Bridge User Actionsbridge_load_page28714294309
bridge_load_asset_picker16548204210
bridge_search_token71420732734
total11879712391324
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup13851177191711214041598
load1171982160810512031356
domContentLoaded1164977160110411991344
domInteractive2817155212479
firstPaint155691176121189274
backgroundConnect20319024111205225
firstReactRender19124252130
initialActions106113
loadScripts978788140410310111164
setupStore1363651622
numNetworkReqs312299202584
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Chrome Browserify Startup Power User HomeuiStartup2842141110490199237036634
load11911028178114412381499
domContentLoaded11741017173113812171485
domInteractive35181492433101
firstPaint205821259172245374
backgroundConnect9502547992137610742812
firstReactRender25176282642
initialActions104112
loadScripts972826150713210151273
setupStore1665991835
numNetworkReqs78381582494118
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Chrome Webpack Startup Standard HomeuiStartup8866961170989481057
load75762097592839907
domContentLoaded75161696691830900
domInteractive2916106222495
firstPaint1055936350122200
backgroundConnect28185393445
firstReactRender18123862033
initialActions105112
loadScripts74861496390826890
setupStore1263851323
numNetworkReqs3122103202588
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Chrome Webpack Startup Power User HomeuiStartup1289981314426713591578
load76666111381097681063
domContentLoaded75465311311107561050
domInteractive40181563039126
firstPaint1527745478175306
backgroundConnect18813396199180285
firstReactRender23183732430
initialActions102112
loadScripts75165011201077541032
setupStore1355071522
numNetworkReqs1044223939131167
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Browserify Startup Standard HomeuiStartup16701425252118117152074
load14041192210313414461608
domContentLoaded14031192210313414461608
domInteractive81343424596140
firstPaint------
backgroundConnect60303283559106
firstReactRender14112111416
initialActions103122
loadScripts13761169206412814201564
setupStore197207281543
numNetworkReqs3121100202788
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Browserify Startup Power User HomeuiStartup28652097804276629363576
load16221318648665615991903
domContentLoaded16211317648665615981902
domInteractive151541023140145401
firstPaint------
backgroundConnect43511112143066501004
firstReactRender18146151923
initialActions203122
loadScripts15801292644365315471868
setupStore12614728169104507
numNetworkReqs82312063597144
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Webpack Startup Standard HomeuiStartup17931488330228718012124
load15041255293521815241688
domContentLoaded15031255293521815241683
domInteractive943025342130146
firstPaint------
backgroundConnect65312603571122
firstReactRender17125651724
initialActions102122
loadScripts14761239290321614991615
setupStore228211291662
numNetworkReqs312090182778
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
Firefox Webpack Startup Power User HomeuiStartup28262023884689028573499
load16441296721478516392008
domContentLoaded16431296721478516392008
domInteractive16147766160148591
firstPaint------
backgroundConnect4171071305295619932
firstReactRender21155562329
initialActions213122
loadScripts16091246717978415841982
setupStore16014806204162641
numNetworkReqs79281783697150
longTaskCount------
longTaskTotalDuration------
longTaskMaxDuration------
tbt------
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2191219220
srpButtonToSrpForm992100102
confirmSrpToPwForm2412526
pwFormToMetricsScreen1711819
metricsToWalletReadyScreen1801718
doneButtonToHomeScreen89420211211125
openAccountMenuToAccountListLoaded746431677027892
total873912588658904
Onboarding New WalletcreateWalletToSocialScreen2170218218
srpButtonToPwForm1042105108
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3503535
agreeButtonToOnboardingSuccess1601616
doneButtonToAssetList83439511291464
total121539615081848
Asset DetailsassetClickToPriceChart3734042
total3734042
Solana Asset DetailsassetClickToPriceChart4624848
total4624848
Import Srp HomeloginToHomeScreen1871618781878
openAccountMenuAfterLogin4114142
homeAfterImportWithNewWallet271828828343229
total448017644684749
Send TransactionsopenSendPageFromHome29134248
selectTokenToSendFormLoaded2793640
reviewTransactionToConfirmationPage86010870870
total91615925941
SwapopenSwapPageFromHome1156115124
fetchAndDisplaySwapQuotes45921646044606
total4711947154719
🌐 Dapp Page Load Benchmarks

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

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±77ms) 🟡 | historical mean value: 1.06s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 731ms (±103ms) 🟢 | historical mean value: 736ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 85ms (±86ms) 🟢 | historical mean value: 80ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 77ms 1.00s 1.77s 1.06s 1.77s
domContentLoaded 731ms 103ms 695ms 1.73s 743ms 1.73s
firstPaint 85ms 86ms 60ms 936ms 84ms 936ms
firstContentfulPaint 85ms 86ms 60ms 936ms 84ms 936ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 332.22 KiB (8.18%)
  • ui: 102.45 KiB (1.24%)
  • common: 468.06 KiB (4.37%)

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

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template size-L team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants