Bug 252545 - [GTK][WPE] Constant high idle CPU usage in front of any logged in page on Trello.com
Summary: [GTK][WPE] Constant high idle CPU usage in front of any logged in page on Tre...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Carlos Garcia Campos
URL: https://trello.com/
Keywords: Performance
Depends on:
Blocks: GLibPerformance
  Show dependency treegraph
 
Reported: 2023-02-19 10:56 PST by Jeff Fortin
Modified: 2024-07-24 05:27 PDT (History)
4 users (show)

See Also:


Attachments
sysprof capture (1.39 MB, application/x-xz)
2023-02-19 10:56 PST, Jeff Fortin
no flags Details
example of CPU usage shown in top (62.39 KB, image/png)
2023-02-19 11:00 PST, Jeff Fortin
no flags Details
sysprof capture with Epiphany 44 on Wayland with Intel Kabylake graphics (703.14 KB, application/x-xz)
2023-05-06 18:41 PDT, Jeff Fortin
no flags Details
screenshot from the sysprof capture of Epiphany 44 (233.13 KB, image/png)
2023-05-06 18:41 PDT, Jeff Fortin
no flags Details
web inspector "timelines" profiling recording (173.28 KB, application/json)
2023-07-01 12:12 PDT, Jeff Fortin
no flags Details
screenshot of the web inspector "timelines" tab (243.38 KB, image/png)
2023-07-01 12:15 PDT, Jeff Fortin
no flags Details
sysprof capture with Epiphany 45 on Wayland with Intel Kabylake graphics (6.70 MB, application/x-xz)
2023-11-17 11:03 PST, Jeff Fortin
no flags Details
sysprof 45 screenshot - flame graph (141.79 KB, image/png)
2023-11-17 11:06 PST, Jeff Fortin
no flags Details
sysprof 45 screenshot - graphics marks (234.88 KB, image/png)
2023-11-17 11:06 PST, Jeff Fortin
no flags Details
sysprof 45 screenshot - call graph, part 1 (174.32 KB, image/png)
2023-11-17 11:07 PST, Jeff Fortin
no flags Details
sysprof 45 screenshot - call graph, part 2 (175.29 KB, image/png)
2023-11-17 11:07 PST, Jeff Fortin
no flags Details
sysprof 45 screenshot - call graph, part 3 (182.49 KB, image/png)
2023-11-17 11:07 PST, Jeff Fortin
no flags Details
sysprof 45 screenshot - call graph, part 4 (160.27 KB, image/png)
2023-11-17 11:07 PST, Jeff Fortin
no flags Details
sysprof 45 screenshot - call graph, part 5 (143.88 KB, image/png)
2023-11-17 11:07 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 2023-02-19 10:56:19 PST
Created attachment 465074 [details]
sysprof capture

When logged into trello.com (with my Google account for auth), on any internal page (ex: the dashboard of your boards, or an individual board), Epiphany (whether version 43.x or nightly) eats the CPU, which is particularly apparent on older hardware like a ThinkPad X220 with Intel Sandybridge graphics (in that case it eats 15-40% of the CPU, and since it keeps waking it up, that means it stays hot and the fan is audible as long as the page is open in Epiphany).

This happens in both normal browser mode and web app mode. Since it makes my CPU burn, it pretty much makes the app mode useless as I can't keep this companion web app running on the side.

It doesn't seem to occur when only visiting the trello.com homepage when not logged in (via a private browser window for example).

Attached is a sysprof capture with the nightly flatpak version on Fedora 37.
Comment 1 Jeff Fortin 2023-02-19 11:00:23 PST
Created attachment 465075 [details]
example of CPU usage shown in top
Comment 2 Jeff Fortin 2023-05-06 18:41:17 PDT
Created attachment 466253 [details]
sysprof capture with Epiphany 44 on Wayland with Intel Kabylake graphics

Here's an addition sysprof capture made under Wayland (I presume my previous one was made under Xorg) with the latest stable versions, and a few more debuginfo packages installed. On this much more modern laptop, it still uses ~30% CPU (according to top) while idling in front of the logged in Trello boards dashboard. The difference here is that the chipset is so power-efficient that you don't necessarily notice, until you look at CPU usage.
Comment 3 Jeff Fortin 2023-05-06 18:41:53 PDT
Created attachment 466254 [details]
screenshot from the sysprof capture of Epiphany 44
Comment 4 Jeff Fortin 2023-07-01 12:12:38 PDT
Created attachment 466895 [details]
web inspector "timelines" profiling recording

Here is a web inspector "timelines" record of what's going on to cause 30% CPU usage (~13-15% by the WebKitWebProcess, then causing 20-25% CPU usage by GNOME Shell) on GNOME 44 with Wayland.
Comment 5 Jeff Fortin 2023-07-01 12:15:08 PDT
Created attachment 466897 [details]
screenshot of the web inspector "timelines" tab
Comment 6 Jeff Fortin 2023-07-01 12:23:46 PDT
Some more data points I forgot to mention:

* Neither Firefox nor Chromium are affected in the same way, they keep the CPU usage low as far as I can see (like maybe 4-7% for the browser, nothing out of the ordinary when idle, and the GNOME Shell process can retain its low/near-zero CPU usage then)

* When this issue happens, it does not "just" affect Epiphany, it slows down the rest of the desktop experience too. So if I want a fluid Wayland GNOME Shell I need to not keep Epiphany opened on that website.

* This does not happen if the window is minimized/hidden (Super+H with GNOME Shell)

Apparently the constant requestAnimationFrame events are making it redraw and  submit buffers for gnome-shell to recomposite constantly, even though it doesn't seem to have any actual layout or paint requests?
Comment 7 Jeff Fortin 2023-11-17 11:03:49 PST
Created attachment 468645 [details]
sysprof capture with Epiphany 45 on Wayland with Intel Kabylake graphics

This capture, made with Sysprof 45 launching the web app directly, probably provides much better data than the previous ones.
Comment 8 Jeff Fortin 2023-11-17 11:06:14 PST
Created attachment 468646 [details]
sysprof 45 screenshot - flame graph
Comment 9 Jeff Fortin 2023-11-17 11:06:48 PST
Created attachment 468647 [details]
sysprof 45 screenshot - graphics marks
Comment 10 Jeff Fortin 2023-11-17 11:07:13 PST
Created attachment 468648 [details]
sysprof 45 screenshot - call graph, part 1
Comment 11 Jeff Fortin 2023-11-17 11:07:24 PST
Created attachment 468649 [details]
sysprof 45 screenshot - call graph, part 2
Comment 12 Jeff Fortin 2023-11-17 11:07:34 PST
Created attachment 468650 [details]
sysprof 45 screenshot - call graph, part 3
Comment 13 Jeff Fortin 2023-11-17 11:07:45 PST
Created attachment 468651 [details]
sysprof 45 screenshot - call graph, part 4
Comment 14 Jeff Fortin 2023-11-17 11:07:55 PST
Created attachment 468652 [details]
sysprof 45 screenshot - call graph, part 5
Comment 15 Roope Salmi 2024-07-10 06:17:58 PDT
> Apparently the constant requestAnimationFrame events are making it redraw and  submit buffers for gnome-shell to recomposite constantly, even though it doesn't seem to have any actual layout or paint requests?

Here's a simple reproduction of constant painting and compositing happening with RAF:

<script>
    function cb() {
	requestAnimationFrame(cb);
    }
    cb();
</script>

Would be interested to know how this behaves on different ports of WebKit, e.g. Safari.
Comment 16 Carlos Garcia Campos 2024-07-22 07:50:33 PDT
Pull request: https://github.com/WebKit/WebKit/pull/31063
Comment 17 EWS 2024-07-24 05:27:24 PDT
Committed 281288@main (18a0d3296eb3): <https://commits.webkit.org/281288@main>

Reviewed commits have been landed. Closing PR #31063 and removing active labels.