Open Bug 2073467 Opened 2 months ago Updated 5 days ago

3428.45 - 4.5% background-resource cpuTime-main-backgrounding-diff + 97 more (Android) regression on Fri September 11 2026

Categories

(Firefox for Android :: Homepage, defect)

All
Android
defect

Tracking

()

ASSIGNED
Tracking Status
firefox156 --- unaffected
firefox157 --- unaffected
firefox158 --- disabled
firefox159 --- disabled
firefox160 --- disabled

People

(Reporter: performance-sheriff-bot, Assigned: npoon)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: perf, perf-alert, regression, Whiteboard: [fxdroid] [group5])

Attachments

(2 external files, 1 obsolete file)

Perfherder has detected a mozperftest performance regression from push 42a535f7941b938f360621f3f4a6f679b3fedf03. As author of one of the patches included in that push, we need your help to address this regression.

Please acknowledge, and begin investigating this alert within 3 business days, or the patch(es) may be backed out in accordance with our regression policy.

Regression Test Platform Options Absolute values [old vs new]
3428% background-resource cpuTime-main-backgrounding-diff android-hw-a55-14-0-aarch64-shippable 852.50 ms -> 30,080.00 ms
3050% background-resource cpuTime-main-backgrounding-diff android-hw-a55-14-0-aarch64-shippable 830.38 ms -> 26,156.67 ms
2968% background-resource cpuTime-total-backgrounding-diff android-hw-a55-14-0-aarch64-shippable 997.50 ms -> 30,605.83 ms
2695% background-resource cpuTime-total-backgrounding-diff android-hw-a55-14-0-aarch64-shippable 955.50 ms -> 26,708.33 ms
2362% background-resource cpuTime-total-background-diff android-hw-a55-14-0-aarch64-shippable 1,420.00 ms -> 34,966.67 ms
2285% background-resource cpuTime-main-background-diff android-hw-a55-14-0-aarch64-shippable 1,259.17 ms -> 30,030.00 ms
701% background-resource cpuTime-tab-background-diff android-hw-a55-14-0-aarch64-shippable 625.00 ms -> 5,003.33 ms
437% foreground-resource cpuTime-tab-end android-hw-a55-14-0-aarch64-shippable 901.67 ms -> 4,839.17 ms
339% background-resource cpuTime-tab-end android-hw-a55-14-0-aarch64-shippable 1,446.67 ms -> 6,346.67 ms
228% background-resource cpuTime-tab-50% android-hw-a55-14-0-aarch64-shippable 1,223.33 ms -> 4,010.00 ms
... ... ... ... ...
6% background-resource rss-gpu-start android-hw-a55-14-0-aarch64-shippable 162,379.52 Kb -> 171,698.67 Kb
6% background-resource rss-gpu-50% android-hw-a55-14-0-aarch64-shippable 162,406.88 Kb -> 171,497.67 Kb
6% background-resource rss-gpu-end android-hw-a55-14-0-aarch64-shippable 162,406.88 Kb -> 171,497.67 Kb
6% background-resource rss-gpu-10% android-hw-a55-14-0-aarch64-shippable 162,379.52 Kb -> 171,460.67 Kb
5% foreground-resource rss-gpu-start android-hw-a55-14-0-aarch64-shippable 163,759.33 Kb -> 171,123.08 Kb
Improvement Test Platform Options Absolute values [old vs new]
5% background-resource pss-crashhelper-50% android-hw-a55-14-0-aarch64-shippable 10,852.15 Kb -> 10,324.00 Kb

Support & Actionable Steps

For questions, please contact fbilt@mozilla.com. You can also find help on Slack (#perf-help) or Matrix (#perftest).

Action guide details:

Flags: needinfo?(gl)

Set release status flags based on info from the regressing bug 1977695

I think the perf regression is because that patch broke generate-baseline-profile-firebase-fenix, which gives us a lot of performance gains on fenix. I'm going to run a perf compare to verify this patch against the patch that fixed the task

https://perf.compare/compare-results?baseRev=2a27b9ba0e2ecdd279c59ad2e5dd0a0a1dd181dd&baseRepo=autoland&newRev=42a535f7941b938f360621f3f4a6f679b3fedf03&newRepo=autoland&framework=15&initialized=1

Flags: needinfo?(gl)

:gl, since you are the author of the regressor, bug 1977695, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(gl)

The perf tests require baseline profile generation to be successful, which is why no perf tests ran for the regressor. I have made 2 pushes with the following tips:

  • Parent of regressor
  • Parent of regressor + regressor + fix
    I'm comparing these 2 pushes and we want net perf-neutral or near net perf-neutral to show that this perf alert got triggered due to the broken baseline profile generation task caused by the regressor, which has now been fixed

https://perf.compare/compare-results?baseRev=babfbca1d6dbd25b02ef2c804063916b9d75c906&baseRepo=try&newRev=59e3d94b187ed1fd890c9515a91e6de7d48439ba&newRepo=try&framework=15&test_version=mann-whitney-u

The bug is marked as tracked for firefox158 (nightly). However, the bug still isn't assigned.

:gl, could you please find an assignee for this tracked bug? Given that it is a regression and we know the cause, we could also simply backout the regressor. If you disagree with the tracking decision, please talk with the release managers.

For more information, please visit BugBot documentation.

Flags: needinfo?(gl)

I need to think about this some more but here are some things I see in the perf compare so far:

We are seeing some perf regressions in some CPU time and memory usage. I think the CPU time increase may be expected given that we now need to wait for about:home to get redirected to the homepage. However, I'm not sure how much we should accept here for the threshold. I also have no idea why we're seeing such a huge memory increase. My hypothesis is that maybe more code is getting JITed due to the new code paths that are being hit when we load the homescreen compared to before but I need to confirm these

Flags: needinfo?(gl)
Assignee: nobody → npoon
Status: NEW → ASSIGNED
Whiteboard: [fxdroid] [group5]
Severity: -- → S2

I've run some profiles to look into this further:
Homepage as new tab on startup profile: https://share.firefox.dev/46HahsH
homepage as new tab off startup profile: https://share.firefox.dev/4rp3tJK

The regressor enables homepage as new tab on nightly only. It will not be riding the trains so I will set it as disabled

Set release status flags based on info from the regressing bug 1977695

See Also: → 2076664

Set release status flags based on info from the regressing bug 1977695

We attempted to run this test locally on a rooted Pixel 6 and it seems like the synthesized UI interactions aren't having the intended effect. Reading through test-android-resource-usage.sh, we would expect the privacy notice to be dismissed, a new tab to be opened, and mozilla.org to be navigated to. None of that seemed to happen. Sparky, can you take a look?

We ran it on a Firefox Nightly installed from the app store.

Flags: needinfo?(gmierzwinski)

(In reply to Markus Stange [:mstange] from comment #11)

Sparky, can you take a look?

Unfortunately I don't have a rooted phone right now - they're hard-bricked. :aglavic, do you have a rooted P6 device you can test this out on?

Flags: needinfo?(gmierzwinski) → needinfo?(aglavic)
Depends on: 2083122

(In reply to Greg Mierzwinski [:sparky] from comment #13)

(In reply to Markus Stange [:mstange] from comment #11)

Sparky, can you take a look?

Unfortunately I don't have a rooted phone right now - they're hard-bricked. :aglavic, do you have a rooted P6 device you can test this out on?

I filed Bug 2083122 for this and uploaded a patch. Can you take a look please :)

Flags: needinfo?(aglavic)

Pref: homepage-as-new-tab

Did some investigation with Markus on the background-resource rss-tab-50% regression:

HNT on keeps exactly one extra content process alive, in all 21 perf test runs. That process accounts for the whole rss-tab increase.

In both builds, one tab process exits between start and 10%. That's the spare Web Content process; in the pref-on profile it was also the process that exited around backgrounding. Everything else persists for the full 10 minutes.

The persistent tab processes at end, in spawn order (by PID), with PSS ranges across runs and total CPU time:

In the representative pair (mem_info_*.txt from jobs 601350494 and 601350069), Y (sandboxed_tab_disable_art_image_1) measures ~182 MB RSS / ~33–35 MB PSS. That matches the Perfherder deltas: rss-tab +181–185 MB, pss-tab +23–26 MB. The PSS delta is a bit smaller than Y's own PSS because adding a process spreads the shared pages more thinly across the others.

What sandboxed_tab is: most likely the Privileged About Content process hosting about:home. Each step below is backed by data or code; the mapping from sandboxed_tab to that process is an inference from spawn order:

  • In the pref-on simpleperf profile the second content process to spawn is "Privileged Content", at about 1.0s. It receives RecvConstructBrowser within the first 2s, before any user navigation.
  • HomepageTabBinding adds an about:home tab whenever there are no tabs on cold boot, if getHomepageAsANewTabEnabled() is true.
    • On Android, about:home is registered in nsAboutRedirector.cpp with URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS, so it can be routed to its own privileged-about process.
    • In that profile the earliest Web Content process (X) also builds a browser before 1s and runs nsDocShell::Destroy between 1s and 2s. That looks like the tab's initial about:blank before it switches to the privileged process.

The eagerly created homepage tab brings in a Privileged About Content process that stays resident for the whole background period. It costs about 180 MB RSS / 33 MB PSS and only ~1s of CPU over 10 minutes.

So the cause chain is:

  1. HomepageTabBinding adds an about:home tab on cold boot.
  2. A GeckoSession is created and loads right away. Its browser first gets an about:blank docshell in a Web Content process.
  3. It then switches to a Privileged About Content process, since about:home is registered with URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS.
  4. That process stays alive through the whole background period.

Two things this doesn't explain:

  • The parent-process CPU regression from bug 2073467 (cpuTime-main-*). sandboxed_tab uses about 1s of CPU, so it can't account for tens of seconds in the parent.
  • Exactly why regular content process's browser is torn down. If the homepage tab could skip creating its GeckoSession until you leave the homepage, or if about:home could avoid loading into a separate process, the extra process would go away.
Attachment #9673604 - Attachment description: WIP: Bug 2073467 - Make about:home and about:blank not load in privileged about content process → Bug 2073467 - Part 1: Make about:home and about:blank not load in privileged about content process

The homepage tab added on cold boot created and loaded its
GeckoSession immediately, which spun up content processes before the
user had left the homepage. The tab is now added without loading, so
the engine session is only created on the first navigation.

Because that navigation is issued right after the initial about:home
load, GeckoEngineSession holds it until about:home commits (or stops).
This keeps the homepage in session history so that going back from
the first page returns to it.

See Also: → 2095144
Attachment #9673604 - Attachment description: Bug 2073467 - Part 1: Make about:home and about:blank not load in privileged about content process → WIP: Bug 2073467 - Part 1: Make about:home and about:blank not load in privileged about content process
Attachment #9685114 - Attachment description: Bug 2073467 - Part 2: Only initialize GeckoEngineSession when navigating from homepage → WIP: Bug 2073467 - Part 2: Only initialize GeckoEngineSession when navigating from homepage
Attachment #9686544 - Attachment description: Bug 2073467 - Part 3: Fix GleanDebugTools back navigation with homepage as new tab → WIP: Bug 2073467 - Part 3: Fix GleanDebugTools back navigation with homepage as new tab
Attachment #9673604 - Attachment description: WIP: Bug 2073467 - Part 1: Make about:home and about:blank not load in privileged about content process → Bug 2073467 - Part 1: Make about:home and about:blank not load in privileged about content process
Attachment #9685114 - Attachment description: WIP: Bug 2073467 - Part 2: Only initialize GeckoEngineSession when navigating from homepage → Bug 2073467 - Part 2: Only initialize GeckoEngineSession when navigating from homepage
Attachment #9686544 - Attachment description: WIP: Bug 2073467 - Part 3: Fix GleanDebugTools back navigation with homepage as new tab → Bug 2073467 - Part 3: Fix GleanDebugTools back navigation with homepage as new tab
Attachment #9673604 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: