Bug 215045 - [GStreamer] Very slow when scrolling Divi websites
Summary: [GStreamer] Very slow when scrolling Divi websites
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: Performance
Depends on:
Blocks: GLibPerformance
  Show dependency treegraph
 
Reported: 2020-07-31 16:54 PDT by Jeff Fortin
Modified: 2023-06-01 01:55 PDT (History)
4 users (show)

See Also:


Attachments
Screencast of scrolling on https://www.elegantthemes.com/gallery/divi/ in Epiphany Tech Preview (17.03 MB, video/webm)
2023-01-22 20:14 PST, Kdwk
no flags Details
sysprof capture of epiphany nightly from 2023-01-24 while scrolling half of that page (8.60 MB, application/x-xz)
2023-01-25 10:42 PST, Jeff Fortin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Fortin 2020-07-31 16:54:55 PDT
Visit https://atypi.ca and try scrolling with Epiphany 3.36.3 (WebKitGTK 2.28.3). It is incredibly sluggish.
If you want a torture test, try to scroll: https://www.elegantthemes.com/gallery/divi/

Firefox and Chromium are not affected at all and scroll those pages smooth like butter.

Tried on two different computers, one running Fedora 32 and the other running Ubuntu 20.04, both on a GNOME Xorg/X11 session.
Comment 1 Jeff Fortin 2020-07-31 17:09:33 PDT
I should also remark that on my machine, even when not scrolling, the 2nd link causes Epiphany's webkitwebprocess to eat 100% of my eight CPUs.
Comment 2 Jeff Fortin 2020-12-22 07:40:32 PST
This happens even if you run it as:
LIBGL_DRI3_DISABLE=1 epiphany

It also happens on all of my machines regardless of the GPU drivers: one is Intel Sandybridge, the other is running the open source radeon drivers. However, on the radeon machine, I see epiphany trying to do things it doesn't like either:

Error loading module '/usr/lib/mozilla/plugins/nppdf.so': /usr/lib/mozilla/plugins/nppdf.so: wrong ELF class: ELFCLASS32
Failed to launch /usr/libexec/webkit2gtk-4.0/WebKitPluginProcess: Failed to execute child process “/usr/libexec/webkit2gtk-4.0/WebKitPluginProcess” (No such file or directory)
radeon: The kernel rejected CS, see dmesg for more information (-22).
(repeated hundreds of times)

dmesg:

[143990.046554] [drm:radeon_cs_ioctl [radeon]] *ERROR* Invalid command stream !
[143990.046670] [drm:radeon_uvd_cs_parse [radeon]] *ERROR* UVD handle collision detected!
(repeated hundreds of times)
Comment 3 Jeff Fortin 2023-01-22 11:59:03 PST
Just for the record: tested this again with Epiphany 43.0 (WebKitGTK 2.38.3), and this is still occurring.

The issue report here is probably the "best" torture-test benchmark you can find out there... it will bring WebKitGTK to its knees, so if you manage to make https://www.elegantthemes.com/gallery/divi/ scroll fast and smoothly in Epiphany, it is possible that almost every other website out there is going to benefit from the combined performance improvements.
Comment 4 Kdwk 2023-01-22 20:14:01 PST
Created attachment 464600 [details]
Screencast of scrolling on https://www.elegantthemes.com/gallery/divi/ in Epiphany Tech Preview

My i7-9700 is able to squeeze a usable framerate out of it, but it is still very laggy and stuttery.
Comment 5 Kdwk 2023-01-22 20:14:58 PST
Maybe this is related to https://bugs.webkit.org/show_bug.cgi?id=247057
Comment 6 Jeff Fortin 2023-01-22 21:19:36 PST
I have no idea so I can't say with authority, but my wild guess is that this has nothing to do with gstreamer or images decoding; it would be a bit surprising, considering that my report here is _much_ older, and I would suspect the issue has been around for years before that too but simply was not noticed (I hadn't encountered and tested this particular "torture test" page until 2020)...
Comment 7 Jeff Fortin 2023-01-25 10:42:11 PST
Created attachment 464650 [details]
sysprof capture of epiphany nightly from 2023-01-24 while scrolling half of that page

Here's a sysprof output when scrolling from the top to about half of that page (it was too long and painful to get to the end of the page) with the two-fingers multitouch trackpad on my i7 Kaby Lake test laptop, on Wayland, in 4K HiDPI. Same hardware/software specs as in bug #250998.
Comment 8 Michael Catanzaro 2023-01-25 10:52:04 PST
Looks like almost all time here is spent inside OpenH264, so this looks like probably a multimedia problem?
Comment 9 Philippe Normand 2023-01-26 10:58:46 PST
(In reply to Michael Catanzaro from comment #8)
> Looks like almost all time here is spent inside OpenH264, so this looks like
> probably a multimedia problem?

This is not the right bugtracker then ;)
Comment 10 Michael Catanzaro 2023-01-26 11:00:40 PST
Sort of, but I think only multimedia developers have enough expertise to successfully report bugs to OpenH264. So we would need your help to move this to OpenH264 upstream. Here is as far as we can expect users and non-multimedia devs to go.
Comment 11 Jeff Fortin 2023-01-26 16:08:56 PST
Interesting, I hadn't realized that Divi theme presentation page was full of silent looping H.264 videos...

https://atypi.ca does not have any videos on the front page however, and it still lags when scrolling, especially in the middle with the logos wall. Am I supposed to fork that into a separate bug report then, or might that be the same issue? Would it benefit from its own sysprof capture?
Comment 12 Philippe Normand 2023-01-27 01:26:56 PST
Isn't there a dozen open bugs about scrolling already?
Comment 13 Kdwk 2023-04-27 02:20:01 PDT
Unable to reproduce with https://atypi.ca/, but https://www.elegantthemes.com/gallery/divi/ still has a couple stutters when the website first loads (in addition to the first video on the site not loading). Tested on Gnome Web 44.2/ WebKitGTK 2.40.1
Comment 14 Kdwk 2023-06-01 01:55:40 PDT
Hi Jeff would you like to test Divi with Gnome Web 44.3/ WebKitGTK 2.40.2? Off-screen videos are now paused to reduce CPU usage, which might help with the problem you mentioned.