feat(perf): auto-enable inline app profiling on failed PR performance tests - #33902
Conversation
When a PR performance run has failed tests, the post-PR-comment job now runs diff-app-profiling.mjs --all automatically and posts the baseline diff table. Manual @metamaskbot re-runs remain available. Adds --current-dir (reuse local aggregated-reports) and --replace (refresh previous profiling comments). Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
If a scenario never goes green on main, still compare against the latest usable profilingSummary and label the baseline as also failing, so PR diffs remain useful. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
gh api without --paginate only returns the first page of issue comments (oldest-first), so recent app-profiling-check comments were missed and duplicate diffs stacked on busy PRs. Also paginate perf-results cleanup. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
|
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. |
When comparing multiple failed scenarios, the second download into the same baseline-* dir failed with "file exists", so later scenarios (e.g. Fresh SRP) incorrectly reported no usable baseline even though profiling existed on main. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4f58459. Configure here.
Export the helper with an injectable runGhFn so unit tests assert the early-return reuse path and the download path without calling gh. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
Show a short regression summary by default and move the full metric table, variance disclaimer, and raw JSON into expandable details. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
Only include scenarios that have both usable current profiling and a comparable baseline on main. Chronically new/unprofiled failures are skipped so the PR comment lists only comparable regressions. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
Merge the separate App Profiling Check comment into the Performance results comment: short summary + collapsed metric table per failed scenario,⚠️ header when tests fail, and drop the auto separate post. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
None of these changes touch any app code, E2E smoke test specs, page objects, selectors, flows, or shared test infrastructure that smoke tests depend on. The changes are entirely about how performance test results are reported in PR comments. No E2E smoke tags are warranted. Performance Test Selection: |
|
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | Quality gates exceeded | 📹 Watch |
🔬 App profiling check · Current run 30438062320 · Baseline (last green on main) run 30431128018 @ c1faefc
Summary:
ℹ️ API calls unavailable:
Network logs API error: Bad Request
Full metric table (+10% variance rules)
Disclaimer — allowed variance: a +10% margin over the baseline is permitted.
- If
Current <= Baseline + 10%, treated as acceptable noise.- If
Current > Baseline + 10%, Current and variance % are highlighted with⚠️ .
| Metric | Baseline | Current | Δ |
|---|---|---|---|
| CPU avg | 8.91% | 10.37% | +1.46 (+16.4%) |
| CPU max | 24.37% | 22.33% | -2.04 (-8.4%) |
| Memory avg | 713.14 MB | 718.37 MB | +5.23 (+0.7%) |
| Memory max | 834.7 MB | 828.83 MB | -5.87 (-0.7%) |
| Slow frames | 25.22% | 18.9% | -6.32 (-25.1%) |
| Frozen frames | 0% | 0% | 0 (0%) |
| ANRs | 0 | 0 | 0 (0%) |
| Issues | 3 | 2 | -1 (-33.3%) |
| Critical issues | 2 | 2 | 0 (0%) |
| App size | 318.33 MB | 318.33 MB | 0 (0%) |
Import SRP with +50 accounts, SRP 1, SRP 2, SRP 3
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | Test error | 📹 Watch |
🔬 App profiling check · Current run 30438062320 · Baseline (last run on main (scenario also failing)) run 30435630458 @ 96deb2a
⚠️ No green baseline onmain— comparing against the latest usable profiling.
Summary:
ℹ️ API calls unavailable:
Network logs API error: Bad Request
Full metric table (+10% variance rules)
Disclaimer — allowed variance: a +10% margin over the baseline is permitted.
- If
Current <= Baseline + 10%, treated as acceptable noise.- If
Current > Baseline + 10%, Current and variance % are highlighted with⚠️ .
| Metric | Baseline | Current | Δ |
|---|---|---|---|
| CPU avg | 7.37% | 5.16% | -2.21 (-30%) |
| CPU max | 24.7% | 23.61% | -1.09 (-4.4%) |
| Memory avg | 709.13 MB | 726.98 MB | +17.85 (+2.5%) |
| Memory max | 753.72 MB | 870.81 MB | +117.09 (+15.5%) |
| Slow frames | 31.13% | 32.03% | +0.9 (+2.9%) |
| Frozen frames | 0% | 0% | 0 (0%) |
| ANRs | 0 | 0 | 0 (0%) |
| Issues | 3 | 3 | 0 (0%) |
| Critical issues | 2 | 2 | 0 (0%) |
| App size | 318.33 MB | 318.33 MB | 0 (0%) |
@mm-perps-engineering-team
Perps add funds
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | Quality gates exceeded | 📹 Watch |
🔬 App profiling check · Current run 30438062320 · Baseline (last green on main) run 30435630458 @ 96deb2a
Summary:
ℹ️ API calls unavailable:
Network logs API error: Bad Request
Full metric table (+10% variance rules)
Disclaimer — allowed variance: a +10% margin over the baseline is permitted.
- If
Current <= Baseline + 10%, treated as acceptable noise.- If
Current > Baseline + 10%, Current and variance % are highlighted with⚠️ .
| Metric | Baseline | Current | Δ |
|---|---|---|---|
| CPU avg | 11.16% | 10.73% | -0.43 (-3.8%) |
| CPU max | 23.7% | 27.22% | +3.52 (+14.9%) |
| Memory avg | 702.57 MB | 711.15 MB | +8.58 (+1.2%) |
| Memory max | 805.65 MB | 809.14 MB | +3.49 (+0.4%) |
| Slow frames | 31.29% | 29.3% | -1.99 (-6.4%) |
| Frozen frames | 0% | 0% | 0 (0%) |
| ANRs | 0 | 0 | 0 (0%) |
| Issues | 3 | 3 | 0 (0%) |
| Critical issues | 2 | 1 | -1 (-50%) |
| App size | 318.33 MB | 318.33 MB | 0 (0%) |
@metamask-onboarding-team
Fresh SRP wallet creation performance
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | Quality gates exceeded | 📹 Watch |
🔬 App profiling check · Current run 30438062320 · Baseline (last green on main) run 30429396115 @ 6b016f4
Summary:
ℹ️ API calls unavailable:
Network logs API error: Bad Request
Full metric table (+10% variance rules)
Disclaimer — allowed variance: a +10% margin over the baseline is permitted.
- If
Current <= Baseline + 10%, treated as acceptable noise.- If
Current > Baseline + 10%, Current and variance % are highlighted with⚠️ .
| Metric | Baseline | Current | Δ |
|---|---|---|---|
| CPU avg | 11.07% | 9.48% | -1.59 (-14.4%) |
| CPU max | 21.09% | 21.93% | +0.84 (+4%) |
| Memory avg | 570.97 MB | 572.35 MB | +1.38 (+0.2%) |
| Memory max | 855.31 MB | 830.44 MB | -24.87 (-2.9%) |
| Slow frames | 5.5% | 36.66% | +31.16 (+566.6%) |
| Frozen frames | 0% | 0% | 0 (0%) |
| ANRs | 0 | 0 | 0 (0%) |
| Issues | 2 | 3 | +1 (+50%) |
| Critical issues | 2 | 2 | 0 (0%) |
| App size | 318.32 MB | 318.33 MB | +0.01 (+0%) |
✅ Passed Tests (17)
| Test | Platform | Device | Duration | Team | Recording |
|---|---|---|---|---|---|
| Asset View, SRP 1 + SRP 2 + SRP 3 | Android | Google Pixel 8 Pro (v14.0) | 2.76s | @assets-dev-team | 📹 Watch |
| Aggregated Balance Loading Time, SRP 1 + SRP 2 + SRP 3 | Android | Google Pixel 8 Pro (v14.0) | 8.25s | @assets-dev-team | 📹 Watch |
| Swap flow - ETH to LINK, SRP 1 + SRP 2 + SRP 3 | Android | Google Pixel 8 Pro (v14.0) | 1.51s | @swap-bridge-dev-team | 📹 Watch |
| Cold Start: Measure ColdStart To Login Screen | Android | Google Pixel 8 Pro (v14.0) | 4.01s | @metamask-mobile-platform | 📹 Watch |
| Measure Warm Start: Login To Wallet Screen | Android | Google Pixel 8 Pro (v14.0) | 1.82s | @metamask-mobile-platform | 📹 Watch |
| Measure Warm Start: Warm Start to Login Screen | Android | Google Pixel 8 Pro (v14.0) | 1.74s | @metamask-mobile-platform | 📹 Watch |
| Predict Available Balance - Complete Flow Performance | Android | Google Pixel 8 Pro (v14.0) | 1.23s | @team-predict | 📹 Watch |
| Predict Deposit - Complete Flow Performance | Android | Google Pixel 8 Pro (v14.0) | 11.73s | @team-predict | 📹 Watch |
| Predict Market Details - Complete Flow Performance | Android | Google Pixel 8 Pro (v14.0) | 4.63s | @team-predict | 📹 Watch |
| Onboarding Import SRP with +50 accounts, SRP 3 | Android | Google Pixel 8 Pro (v14.0) | 11.58s | @metamask-onboarding-team | 📹 Watch |
| Measure Cold Start To Onboarding Screen | Android | Google Pixel 8 Pro (v14.0) | 4.23s | @metamask-mobile-platform | 📹 Watch |
| Cold Start after importing a wallet | Android | Google Pixel 8 Pro (v14.0) | 1.50s | @metamask-mobile-platform | 📹 Watch |
| Account creation after fresh install | Android | Google Pixel 8 Pro (v14.0) | 3.47s | @metamask-onboarding-team | 📹 Watch |
| Seedless Onboarding: Apple Login New User | Android | Google Pixel 8 Pro (v14.0) | 10.93s | @metamask-onboarding-team | 📹 Watch |
| Perps open position and close it | Android | Google Pixel 8 Pro (v14.0) | 17.33s | @mm-perps-engineering-team | 📹 Watch |
| Seedless Onboarding: Google Login New User | Android | Google Pixel 8 Pro (v14.0) | 10.37s | @metamask-onboarding-team | 📹 Watch |
| Seedless Onboarding: Telegram Login New User | Android | Google Pixel 8 Pro (v14.0) | 9.92s | @metamask-onboarding-team | 📹 Watch |
Branch: MMQA-enable-app-profiling · Build: Normal · Commit: 09400eb · View full run

Description
Failed PR performance runs previously posted two comments: Performance Test Results (with copy/paste
@metamaskbotcommands) and a separate long App Profiling Check comment. That made PRs noisy and hard to scan.This change embeds app profiling into the single Performance Test Results comment:
main, show an inline App profiling check (short Summary + collapsed full metric table)## ⚠️ Performance Test Resultswhen there are failures (⚡when all green)mainwhen the scenario is also red, labeled clearly@metamaskbot/workflow_dispatchstill works)<!-- perf-test-results -->and legacy<!-- app-profiling-check -->commentsChangelog
CHANGELOG entry: null
Related issues
Refs: MMQA-2081 (follow-up: auto-enable inline app profiling on failed PR performance scenarios)
Manual testing steps
Local unit verification:
Screenshots/Recordings
N/A — CI/workflow and Node script changes only; no app UI. Evidence is the unified Performance Test Results PR comment produced by
run-performance-e2e.yml.Before
Two comments: Performance results (bot command column) + a separate long App Profiling Check comment.
After
One Performance Test Results comment with⚠️ on failures and compact inline profiling under each failed scenario.
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist