Closed Bug 1879987 Opened 9 months ago Closed 7 months ago

Firefox UI hangs for a long time after moving the window [ GetScreenBounds() / gdk_window_get_root_origin()]

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 122
x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
126 Branch
Performance Impact low
Tracking Status
firefox126 --- fixed

People

(Reporter: mirh, Assigned: stransky)

References

(Regressed 1 open bug)

Details

(Keywords: perf-alert, perf:responsiveness)

Attachments

(3 files)

When I move the browser window on the desktop, the menus just get stuck.
And while webpages still proceed on their own, you cannot interact with them.
This can continue from.. I don't know, 15 to 60 seconds probably?

(I'm not sure what happened to the bugzilla form then - anyway I'm on Manjaro with the Nvidia 545.29.06 drivers. I'm also using the latest stable KDE under X11)

OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Version: unspecified → Firefox 122
Component: General → Performance
Product: Firefox → Core

Of note that resizing the window (or enabling and disabling fullscreen) doesn't seem to have any particular performance hit, other than those normal few seconds to presumably recalculate the tab strip sizes and all.

This bug was moved into the Performance component.

:mirh, could you make sure the following information is on this bug?

  • For slowness or high CPU usage, capture a profile with http://profiler.firefox.com/, upload it and share the link here.
  • For memory usage issues, capture a memory dump from about:memory and attach it to this bug.
  • Troubleshooting information: Go to about:support, click "Copy raw data to clipboard", paste it into a file, save it, and attach the file here.

If the requested information is already in the bug, please confirm it is recent.

Thank you.

Flags: needinfo?(mirh)
Attached file support.txt

https://share.firefox.dev/3T3osm4

Btw, after leaving the "just launched" browser open for a full night, and after having tried to simultaneously open like 20 Wikipedia pages.. I think I can rule out the amount of time elapsed or the amount alone of tabs loaded has anything to do with the problem.

Conversely after opening just a dozen Pixiv tabs, I could reproduce the slowdown immediately (even though it's like a few seconds now after a clean start, as opposed to the very bad numbers I mentioned in the OP). Bug 1855859 suggests this may not be so surprising (or who knows, perhaps it's a X11 bug?) but what I'm still missing is why this only happens after some "content" has been opened.

Flags: needinfo?(mirh)

Thanks for the profile, mirh, and sorry for the delay in analysis.

This profile is very helpful - I can see the main thread being stuck for several seconds at a time. Firefox appears to be stuck waiting on a reply from the X server, and is polling until that reply comes in.

Moving to the Widget :: Gtk component so that our Gtk folk can take a look.

The Performance Impact Calculator has determined this bug's performance impact to be low. If you'd like to request re-triage, you can reset the Performance Impact flag to "?" or needinfo the triage sheriff.

Impact on browser: Renders browser effectively unusable
Impact on site: Causes noticeable jank
Configuration: Specific but common
Websites affected: Rare

Performance Impact: --- → low
Component: Performance → Widget: Gtk

Looks like we're blocked at gdk_window_get_root_origin() call.

As a workaround you can use Wayland backend which implements gdk_window_get_root_origin() differently.

Summary: Firefox UI hangs for a long time after moving the window → Firefox UI hangs for a long time after moving the window [ GetScreenBounds() / gdk_window_get_root_origin()]

We may try to cache gdk_window_get_root_origin() values.

Flags: needinfo?(stransky)
Priority: -- → P3
Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(stransky)
Attachment #9391043 - Attachment is obsolete: true
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/3d46becb9ecd [Linux] Cache gdk_window_get_root_origin() window position at nsWindow::GetScreenBounds() r=emilio
Attachment #9391043 - Attachment is obsolete: false
Flags: needinfo?(stransky)
Keywords: leave-open
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/c34023ddb0a5 [Linux] Cache gdk_window_get_root_origin() window position at nsWindow::GetScreenBounds() r=emilio
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/21247c16b00c [Linux] Cache gdk_window_get_origin() window position at nsWindow::WidgetToScreenOffset() r=emilio

This has an impact on the console typing test (which display a popup). The first patch triggered alert #41988 (as of Sat, 23 Mar 2024 19:57:26 GMT) ==

Regressions:

Ratio Test Platform Options Absolute values (old vs new)
26% damp console.typing linux1804-64-shippable-qr e10s fission stylo webrender-sw 527.01 -> 666.08
21% damp console.typing linux1804-64-shippable-qr e10s fission stylo webrender 558.17 -> 676.15

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=41988

The second one mitigated this: == Change summary for alert #42022 (as of Wed, 27 Mar 2024 08:57:56 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
14% damp console.typing linux1804-64-shippable-qr e10s fission stylo webrender-sw 662.67 -> 567.51
13% damp console.typing linux1804-64-shippable-qr e10s fission stylo webrender 682.58 -> 592.58

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=42022


but overall, this regressed the test a bit

(In reply to Pulsebot from comment #14)

Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/c34023ddb0a5
[Linux] Cache gdk_window_get_root_origin() window position at
nsWindow::GetScreenBounds() r=emilio

== Change summary for alert #42064 (as of Fri, 29 Mar 2024 13:01:51 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
7% tresize linux1804-64-shippable-qr e10s fission stylo webrender-sw 30.01 -> 27.80
7% tresize linux1804-64-shippable-qr e10s fission stylo webrender 30.14 -> 27.96
6% tresize linux1804-64-shippable-qr e10s fission stylo webrender-sw 29.87 -> 27.96

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=42064

Keywords: perf-alert

mirh, can you try latest nightly and check if you see performance improvement?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems#Testing_Mozilla_binaries
Thanks.

Flags: needinfo?(mirh)

Yes, absolutely 0 delay now.

Flags: needinfo?(mirh)
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch

Btw do you think this should also be notified to the freedesktop guys?
Or is it not that concerning, and just a specific FF problem?

(In reply to mirh from comment #22)

Btw do you think this should also be notified to the freedesktop guys?
Or is it not that concerning, and just a specific FF problem?

It's known issue on X11.

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

Attachment

General

Creator:
Created:
Updated:
Size: