Closed Bug 2008913 Opened 1 month ago Closed 29 days ago

Firefox became incredibly slow

Categories

(Core :: Widget: Gtk, defect)

Firefox 148
defect

Tracking

()

RESOLVED FIXED
148 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox146 --- unaffected
firefox147 --- unaffected
firefox148 + fixed

People

(Reporter: nicolo.ribaudo, Assigned: emilio)

References

(Regression)

Details

(Keywords: perf-alert, regression)

Attachments

(5 files)

I came back from the holidays and Firefox is now so slow that it's unusable. It takes about a second to react to input in web pages, or to open Firefox's own menus, or to switch between tabs. It is also happening in private mode.

My current Firefox version is 148.0a1 (2026-01-06), but it also had the same problem with a few-weeks-old nightly version (before I updated this morning).

My OS is Ubuntu 25.04 with X11. Only Firefox became slow, and not other applications.

Is there any data I can provide to help figuring out the problem?

Disabling all extensions did not help. Uninstalling and reinstalling Firefox also did not help.

However, I tried installing Firefox stable (146.0) and it does not have the same problem.

Attached file about:support

Thank you!

I checked with htop, and when I click on the "three lines" button to open the firefox menu from the toolbar I can see very high CPU usage (3-4 cores jump above 50%) for the 1 second that it takes to open the menu.

Hardware acceleration is enabled, and my graphics driver are all up-to-date.

I also tried deleting the only profile I had and creating a new one (for some reason my Firefox doesn't have the "Refresh Firefox" button, so I had to do it manually) and the situation did not improve.

If Firefox 146 is OK then maybe mozregression will reveal when things changed for you.

Flags: needinfo?(nicolo.ribaudo)

Thank you, that is an incredible tool :)

I tried twice just to be sure, and both times it pointed to https://hg-edge.mozilla.org/integration/autoland/pushloghtml?fromchange=9046260c4eb88cb1eacf995766ffbac93974013b&tochange=3e6d24d16e3215499ea9cdf2feedbde68d447524 as the first bad revision

 3:25.63 INFO: Last good revision: 9046260c4eb88cb1eacf995766ffbac93974013b
 3:25.63 INFO: First bad revision: 3e6d24d16e3215499ea9cdf2feedbde68d447524
Flags: needinfo?(nicolo.ribaudo)

Some extra potentially useful information is that my PC is set to use fractional scaling at 125% for the display size, which maybe causes more things to be rendered through some slower paths.

Keywords: regression
Regressed by: 2007997

I'm attaching a video that shows the problem.

Left is nightly (with the bug), right is stable (working properly). The terminal at the bottom shows when I actually click on the mouse.

Edit: Oh well, the video has terrible encoding artifacts. I'll try to get a better one. However, it still shows how slow it is to open the menu in the left before that the video breaks :)

Can you go to https://profiler.firefox.com, click the toolbar button, select the "Graphics" profile and share a profile so we can see what's going on?

Also can you confirm you're using X11, not wayland?

Flags: needinfo?(nicolo.ribaudo)

Oh you mention x11 in comment 0. Also can you confirm this repros on a clean profile or without the alpenglow theme? It should, but just to confirm.

I think the thing I missed that was hitting this codepath was the X11 window decorations (the bits of the shadow around the corner). Can you confirm Firefox is fast in a maximized window, or in fullscreen, but slow in a normal-sized window?

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

https://share.firefox.dev/49m5de9 This profile should include:

  • close the profiler menu
  • open the main menu
  • close the main menu
  • open the main menu again
  • close the main menu again
  • open the profiler menu

Also can you confirm this repros on a clean profile or without the alpenglow theme? It should, but just to confirm.

It does repro on a clean profile, but it feels worse with my normal profile. I'm not sure if I'm just imagining it.

Can you confirm Firefox is fast in a maximized window, or in fullscreen, but slow in a normal-sized window?

Yes, it's much faster with a maximized window. I never use firefox maximized and didn't notice.

(fwiw, given that we are apparently moving towards a x11-less world, as a x11 user I'd also just be ok if Firefox simply disabled those bits of shadow)

Flags: needinfo?(nicolo.ribaudo)
Flags: needinfo?(emilio)

We only need to draw the corners really, so avoid wasting a whole
massive surface.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

We only use this codepath to draw the window decorations in X11 now,
but we never paint directly with Moz2D to the screen on the main window
nowadays.

You fixed this ages ago upstream :)

Attachment #9536214 - Attachment description: Bug 2008913 - Draw window decorations with cairo using a nine-patch image. r=stransky,lsalzman,#gfx-reviewers → Bug 2008913 - Draw window decorations with cairo using a four-patch image. r=stransky,lsalzman,#gfx-reviewers

Can you confirm when this lands (or here if you prefer) that performance is reasonable / as good or better than it was before the regression for you? I don't see such terrible performance on my end as your profile shows...

Flags: needinfo?(emilio) → needinfo?(nicolo.ribaudo)
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/54f788322211 https://hg.mozilla.org/integration/autoland/rev/ea1bc98be162 Remove some now unreachable codepaths in gtk theme drawing. r=lsalzman,gfx-reviewers
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a16418125450 https://hg.mozilla.org/integration/autoland/rev/9756a4180e30 Draw window decorations with cairo using a four-patch image. r=lsalzman,gfx-reviewers
Blocks: 2009169
Component: General → Widget: Gtk
Product: Firefox → Core

I just tested the latest nightly (released at https://hg-edge.mozilla.org/mozilla-central/rev/74f40e6ee9d0a1e2bfd88a015c81bf563c56dced), and now the performance feels the same as before the regression. Thank you!

Flags: needinfo?(nicolo.ribaudo)

(In reply to Pulsebot from comment #19)

Pushed by ealvarez@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/a16418125450
https://hg.mozilla.org/integration/autoland/rev/9756a4180e30
Draw window decorations with cairo using a four-patch image.
r=lsalzman,gfx-reviewers

Perfherder has detected a talos performance change from push 9756a4180e30ffb2ae2a16e504348d78a4c90fc9.

No action is required from the author; this comment is provided for informational purposes only.

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
37% tresize linux1804-64-shippable-qr e10s fission stylo webrender 33.24 -> 20.87
37% tresize linux1804-64-shippable-qr e10s fission stylo webrender-sw 30.90 -> 19.55
3% startup_about_home_paint_cached linux1804-64-shippable-qr e10s fission stylo webrender-sw 1,059.50 -> 1,026.83
2% startup_about_home_paint linux1804-64-shippable-qr e10s fission stylo webrender-sw 1,046.08 -> 1,021.75

Need Help or Information?

If you have any questions, please reach out to afinder@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

Keywords: perf-alert
QA Whiteboard: [qa-triage-done-c149/b148]

(In reply to Pulsebot from comment #19)

Pushed by ealvarez@mozilla.com:
https://github.com/mozilla-firefox/firefox/commit/a16418125450
https://hg.mozilla.org/integration/autoland/rev/9756a4180e30
Draw window decorations with cairo using a four-patch image.
r=lsalzman,gfx-reviewers

Perfherder has detected a devtools performance change from push 9756a4180e30ffb2ae2a16e504348d78a4c90fc9.

No action is required from the author; this comment is provided for informational purposes only.

Improvement Test Platform Options Absolute values [old vs new]
3% damp cold.inspector.open.DAMP (doc) linux1804-64-shippable-qr e10s fission stylo webrender 398.65 ms -> 384.99 ms

Need Help or Information?

If you have any questions, please reach out to fbilt@mozilla.com. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: