Closed Bug 1305367 Opened 8 years ago Closed 8 years ago

Very slow jerky scrolling consuming 100% CPU under Linux/NVIDIA binary drivers

Categories

(Core :: Graphics, defect, P3)

49 Branch
x86_64
Linux
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
platform-rel --- -

People

(Reporter: aros, Unassigned)

References

()

Details

(Keywords: perf, regression, Whiteboard: [gfx-noted][platform-rel-nVidia])

Attachments

(1 file)

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

Steps to reproduce:

All recent GTK3 based official Firefox'es are painfully slow to scroll any pages, while consuming 100% of CPU.

Steps to reproduce:

* Have a PC with a NVIDIA GPU
* Install Fedora 24 64 + all updates.
* Install binary NVIDIA drivers 370.28
* Download and unpack https://ftp.mozilla.org/pub/firefox/releases/49.0.1/linux-x86_64-EME-free/en-US/firefox-49.0.1.tar.bz2
* Visit slashdot.org and try to scroll using your mouse while holding the scroll bar

I have zero add ons installed.
GTK2 based Firefox 45.4ESR is blazing fast.


Actual results:

100% CPU usage, very jerky movement, heavy tearing


Expected results:

Smooth scrolling
Severity: normal → major
OS: Unspecified → Linux
Priority: -- → P5
Hardware: Unspecified → x86_64
firefox-49.0-2.fc24.x86_64.rpm from Fedora exhibits the same problem.

I cannot test nouveau on this PC because my GPU (Pascal based) is not supported by the open source driver.
My only GTK3 setting is:

$ cat /home/birdie/.config/gtk-3.0/settings.ini
[Settings]
gtk-primary-button-warps-slider=false

The only additional theme package installed is adwaita-gtk2-theme-3.20.2-1.fc24.x86_64.rpm, i.e. I'm running the default GTK3 theme.

I'm running XFCE. This problem is reproducible *with* and *without* compositing enabled.
This issue is reproducible under the plain X.org server (i.e. with no WM running).

`top` for Firefox 49:

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND    
10849 root      20   0  208532  65280  49700 R  77.5  0.4   1:10.09 Xorg       
11035 birdie    20   0  905080 249196 126828 S  19.2  1.5   0:31.77 Web Content
10949 birdie    20   0 1392976 447536 166708 S  17.9  2.7   0:36.88 firefox    

`top` for Firefox 45.4ESR:

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND    
11488 birdie    20   0 1188956 349984  81472 S  25.3  2.1   0:18.60 firefox    
10849 root      20   0  193812  50808  33608 S   8.0  0.3   1:21.62 Xorg

both taken while scrolling this bug report webpage.
Is there a build of Firefox 49 for GTK2? I'd love to use it. Meanwhile I'm reverting back to the ESR tree because I cannot tolerate such a horrible performance.
Blocks: gtk3
Does it resolve if you enable "gfx.xrender.enabled" ?
(In reply to Jan Steffens from comment #5)
> Does it resolve if you enable "gfx.xrender.enabled" ?

It helps a lot, thank you!

It doesn't completely resolve the bug because even though scrolling becomes almost as smooth as with GTK2, overall CPU usage is still at least twice as large:

`top` for Firefox 49 + gfx.xrender.enabled = true:

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
10849 root      20   0  198172  51988  33340 S  34.0  0.3   1:53.36 Xorg       
11888 birdie    20   0  850868 230184 100532 S  28.0  1.4   0:11.81 Web Content
11815 birdie    20   0 1217516 364332 109548 S  21.0  2.2   0:16.33 firefox
With gfx.xrender.enabled = true, the performance of https://testdrive-archive.azurewebsites.net/Performance/PsychedelicBrowsing/Default.html falls 100fold (from 1500fps to 15fps).

Is there a middle ground so that scrolling was smooth and HTML rendering was properly accelerated?
This setting is apparently useless for https://www.linux.org.ru/tag/nvidia - on this page scrolling is horribly slow (in Firefox 49).

Damn. Let's go back to Firefox 45.4.
Firefox 45.4 + default settings:

 Scrolling:

 https://slashdot.org - fast, OK
 https://www.linux.org.ru/tag/nvidia - fast, OK
 https://bugzilla.mozilla.org/show_bug.cgi?id=1305367 - fast, OK

 Demos:

 https://testdrive-archive.azurewebsites.net/Performance/PsychedelicBrowsing/Default.html - 1890fps


Firefox 49:

 Scrolling is universally slow or very slow on https://www.linux.org.ru/tag/nvidia + gfx.xrender.enabled
 PsychedelicBrowsing is fast (1500fps) but terribly slow (15fps) with gfx.xrender.enabled


What's the exact purpose of the GTK3 build of Firefox? To drive people from Linux? It's a pain to use, it's broken in great many ways. I do understand it's the "future" but you should have enabled it only for alpha builds - not on production builds. When Firefox 45 ESR stops being supported and GTK3 build is still broken, I will either start compiling my own GTK2 builds or migrate to Chrome.
Component: Untriaged → Graphics
Product: Firefox → Core
FYI, Firefox 49.0.1 runs great here with all your examples on ARCH/Manjaro with Nvidia 370.28, latest Nightly is even faster (OpenGL composition on by default). Maybe the performance-regression is Fedora-specific?
(In reply to Stebs from comment #10)

If only I knew how to test your hypothesis. What I see is that Firefox 45.4 has zero performance related problems while Firefox 49 is barely usable.
AFAIK, FF45 doesn't have the support about Gtk3, it starts only since FF46.
Yep.

Anyways Fedora is quite a popular Linux distro, I'd even venture to say it's a major one, so this bug deserves at least a modicum of attention.
Has STR: --- → yes
Keywords: perf, regression
Priority: P5 → P3
Whiteboard: [gfx-noted]
Could you capture a profile of the CPU usage while the performance issue is happening using gecko's builtin profiler?

There are instructions here: https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler

It will point us to the parts of firefox that are consuming a lot of CPU resources.
Flags: needinfo?(t.artem)
Attached file profile.json.bz2 (deleted) —
(In reply to Nicolas Silva [:nical] from comment #14)

For some reasons the original bug report has autoresolved/disappeared (I've upgraded to Firefox 49.0.1: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0). Now I've got a slow down only while scrolling https://www.linux.org.ru/tag/nvidia

Here's profiling information.
Flags: needinfo?(t.artem)
platform-rel: --- → ?
Whiteboard: [gfx-noted] → [gfx-noted][platform-rel-nVidia]
platform-rel: ? → -
Cannot reproduce with:

Firefox 50.0.2 x86-64
Fedora 25 x86-64
Kernel 4.8.10
NVIDIA drivers 375.10
Default Firefox Settings
More or less default NVIDIA settings:

Section "Device"
        Identifier      "Videocard0"
        BusID           "PCI:1:0:0"
        Driver          "nvidia"
        VendorName      "NVIDIA"
        BoardName       "NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1)"
        Option          "Coolbits" "28"
        Option          "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3"
        Option          "TripleBuffer" "On"
EndSection


Psychedelic Browsing ~ 1427 Revolutions per Minute.

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

Attachment

General

Created:
Updated:
Size: