Closed Bug 1493493 Opened 6 years ago Closed 5 years ago

Firefox Wayland slower than XWayland

Categories

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

64 Branch
x86_64
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jean-louis, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0
Build ID: 20180921100113

Steps to reproduce:

I did rebuild the Firefox package on Ubuntu 18.04 with --enable-default-toolkit=cairo-gtk3-wayland. (You can find it on https://launchpad.net/~dupondje/+archive/ubuntu/ppa fyi).

Installed this package :)


Actual results:

I noticed the fonts are way sharper then on XWayland! Its really a visible improvement. But the biggest drawback is that the speed is really bad! The browsing experience is really slow :(


Expected results:

I would expect that Firefox Wayland is faster on Wayland then the XWayland version. But seems this is not the case!

It might be I need to enable some additional options in about:config? But then, why are they not enabled by default? :)
Blocks: wayland
Component: Untriaged → Graphics
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → x86_64
Version: 62 Branch → 64 Branch
Let's try Widget: GTK first given the description :)
Component: Graphics → Widget: Gtk
Summary: Firefox Wayland slower then XWayland → Firefox Wayland slower than XWayland
The thing that is a real disaster is typing. Your cursor lag is like 30 seconds (for real) :(
> I noticed the fonts are way sharper then on XWayland! Its really a visible improvement.

Is it possible that you are running Firefox on a monitor with HiDPI? Afaik, Xorg/Xwayland has no (good) support for HiDPI, at least not with Gtk+, but on Wayland it does. As a result, Firefox has to do much more work to render much more pixels which may be the cause for higher CPU usage causing slowness.

> The thing that is a real disaster is typing. Your cursor lag is like 30 seconds (for real) :(

What is your Wayland compositor? If it is GNOME shell, you may be seeing a few known bugs in GNOME shell/mutter, e.g. https://bugzilla.redhat.com/show_bug.cgi?id=1565931
I'm not seeing any obvious performance problems with my master build with a HiDPI display. Could you try that? My .mozconfig looks like:

    . $topsrcdir/browser/config/mozconfig

    ac_add_options --disable-crashreporter
    ac_add_options --disable-tests
    ac_add_options --disable-updater

    ac_add_options --enable-default-toolkit=cairo-gtk3-wayland
    ac_add_options --enable-release

    ac_add_options --libdir="$LIBDIR"
    ac_add_options --prefix="$PREFIX"

    mk_add_options AUTOCLOBBER=1
    mk_add_options BUILD_OFFICIAL=1
    mk_add_options MOZILLA_OFFICIAL=1
    mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir

This is on Debian testing, Gnome Shell/Mutter 3.30, external 3840x2160 display, Intel HD integrated graphics (i915).
(In reply to Jean-Louis Dupond from comment #2)
> The thing that is a real disaster is typing. Your cursor lag is like 30
> seconds (for real) :(

I see it also on Fedora 28/XWayland/Gtk 3.22/X11 Firefox sometime, may be related to mutter/gnome-shell. I'm really looking forward to use a different compositor.

Anyway, I don't see Wayland related performance issues on Fedora 28/Gtk 3.22 - it may be related to 3.30 which is pretty fresh.
(In reply to Christian Stadelmann from comment #3)
> What is your Wayland compositor? If it is GNOME shell, you may be seeing a
> few known bugs in GNOME shell/mutter, e.g.
> https://bugzilla.redhat.com/show_bug.cgi?id=1565931

=> I'm using Gnome/mutter indeed!

Tried upgrading mutter (updating to Ubuntu 18.10), but have to test a new build of Firefox with Wayland enabled first. (To bad there isn't a wayland nightly :))
(In reply to Jean-Louis Dupond from comment #6)
> (In reply to Christian Stadelmann from comment #3)
> > What is your Wayland compositor? If it is GNOME shell, you may be seeing a
> > few known bugs in GNOME shell/mutter, e.g.
> > https://bugzilla.redhat.com/show_bug.cgi?id=1565931
> 
> => I'm using Gnome/mutter indeed!
> 
> Tried upgrading mutter (updating to Ubuntu 18.10), but have to test a new
> build of Firefox with Wayland enabled first. (To bad there isn't a wayland
> nightly :))

Wayland nightly is available as flatpak at https://firefox-flatpak.mojefedora.cz/
Omg, I had tomatoes on my eyes and only noticed the first sentence. https://mozilla.logbot.info/gfx/20180923#c15359424-c15359429 Sorry!
I confirm this. I've compiled firefox with wayland backend an got very poor performance (it literally took several seconds to respond to my actions). I rebuilt it with the default backend and it runs nice and smooth. I use sway BTW.
Same experience with sway (1.0 beta, wlroots backend) as in [comment 9].
Doing a bit of testing here, this slowness exists with the Flatpak Nightly build under Sway/wlroots git master as mentioned by others, but -not- under Plasma 5.14's Wayland session.  Plasma does exhibit other bugs, such as not being able to click on menus in Firefox's Wayland session.
I can confirm very bad performance with Sway (master). Using Weston or Gnome performance is much better.
I am using Fedora 29, gpu Intel 520, latest Firefox Nightly.

This issue was fixed (for me) couple months ago. Performance is actually better then on XWayland, especially with webrender. Anybody still experiencing this?

Thanks for the info, closing.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.