Bug 778926 - [gnome-terminal] Very poor scrolling performance on wayland with high DPI
[gnome-terminal] Very poor scrolling performance on wayland with high DPI
Status: NEW
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2017-02-19 22:49 UTC by François Guerraz
Modified: 2017-12-21 09:00 UTC (History)
4 users (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments
gnom-shell profiling (438.72 KB, text/plain)
2017-02-22 12:55 UTC, François Guerraz
Details
gnome-terminal-server profiling (1.29 MB, text/plain)
2017-02-22 12:56 UTC, François Guerraz
Details

Description François Guerraz 2017-02-19 22:49:12 UTC
On wayland, just running 

while true; do echo 1; sleep 0.1; done

is enough to have gnome-terminal & gnome-shell using 30%CPU *each*. This is not immediate and pre-filling the buffer helps reproducing the issue.
Comment 1 François Guerraz 2017-02-19 22:55:13 UTC
For comparison on X11, the combined CPU usage of gnome-shell, gnome-terminal and Xorg is negligible (<10% whilst keeping the CPU at the lowest frequency)
Comment 2 Christian Persch 2017-02-20 16:22:37 UTC
Is that with a gnome-terminal from upstream git/tarball, or from some distro with the transparency patch (e.g. fedora) ?
Comment 3 François Guerraz 2017-02-20 16:24:49 UTC
That's on arch, the PKGBUILD shows that there is no patch applied at all.
Just in case it's relevant, I have a HiDPI screen with UI scaling set to 2.
Comment 4 Christian Persch 2017-02-20 18:30:15 UTC
Since gnome-terminal & vte don't have any gdk backend specific code, it's highly unlikely to be due to something g-t/vte do. Most likely some problem in gtk+/gdk, and possibly a duplicate of bug 772075.
Comment 5 François Guerraz 2017-02-20 18:53:33 UTC
I'm sure you know but the patch for bug 772075 is included in the version I'm using. Also, even if the vte being refreshed is in a tab in the background, CPU usage is still as high even if there is nothing visible to refresh.
Comment 6 Christian Persch 2017-02-20 21:14:11 UTC
(In reply to François Guerraz from comment #5)
> I'm sure you know but the patch for bug 772075 is included in the version
> I'm using. 

How could I know one way or the other, since the gtk+ version used is not mentioned in this bug report.
Comment 7 François Guerraz 2017-02-20 21:30:34 UTC
Apologies, this comment came out wrong :-)

I'm using extra/gtk3 3.22.8-1 from arch, which AFAIK includes that patch.
Comment 8 François Guerraz 2017-02-22 12:55:43 UTC
Created attachment 346436 [details]
gnom-shell profiling

With gtk3 2.22.8 arch compiled with -fno-omit-frame-pointer
Comment 9 François Guerraz 2017-02-22 12:56:24 UTC
Created attachment 346437 [details]
gnome-terminal-server profiling

With gtk3 2.22.8 arch compiled with -fno-omit-frame-pointer
Comment 10 François Guerraz 2017-02-26 22:29:31 UTC
I found a workaround: unticking "Show scrollbar" in the g-t profile reduces the CPU usage to almost nothing (similar to the normal behaviour on X11)
Comment 11 Jan Alexander Steffens (heftig) 2017-03-01 09:42:07 UTC
I see this message from gnome-terminal-server in my log a few times:

Allocating size to GtkScrollbar 0x1670390 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?

Maybe it's related.
Comment 12 Christian Persch 2017-04-01 20:44:22 UTC
I think what's happening is that with the scrollbar visible, each scroll adjustment change queues a full resize of the window, which in turn recalcs the window shadows which for some reason are (/were?) expensive to redraw on high DPI.
Comment 13 François Guerraz 2017-04-13 15:03:30 UTC
Not sure about that, disabling the scrollbars only helps, it doesn't fix the issue and the problem also occurs in full screen mode and there are no shadows in that case (or at lease, they should not be calculated).
Comment 14 François Guerraz 2017-07-23 08:10:24 UTC
FYI this is still unresolved and it's a shame that a scrolling terminal uses more power that watching an HD movie.

Can you confirm you can at least reproduce the problem? If not I can try to provide more information, find a more detailed test case, anything.

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