After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787704 - GTK GL widgets use very high CPU
GTK GL widgets use very high CPU
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkGLArea
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-09-15 03:36 UTC by Daniel van Vugt
Modified: 2018-05-02 19:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel van Vugt 2017-09-15 03:36:53 UTC
GTK GL widgets use very high CPU

For example:
gdkgears: 77% CPU
glxgears: 2% CPU
es2gears: 4% CPU

I haven't profiled it yet but a quick look at the code makes me suspect glReadPixels;
  
https://www.khronos.org/opengl/wiki/Common_Mistakes#Texture_upload_and_pixel_reads
https://www.khronos.org/opengl/wiki/Synchronization
Comment 1 Emmanuele Bassi (:ebassi) 2017-09-15 10:32:19 UTC
Thanks; we do have a code path that uses glReadPixels(), and we only use it for blending transparent GL rendering on top of GTK widgets, or if the underlying GL machinery does not support blitting render buffers and texturing is also broken:

https://git.gnome.org/browse/gtk+/tree/gdk/gdkgl.c?h=gtk-3-22#n640

Of course, glxgears and es2gears are not benchmarks or comparison points, since gdkgears does a fair amount more work to begin with. ;-)
Comment 2 Daniel van Vugt 2017-09-18 01:27:41 UTC
Benchmarks no, but the numbers in the description indicate a bug at least.

P.S. I also noticed performance (when maximized) got significantly worse in master (GTK-4) compared to the gtk-3-22 branch.
Comment 3 GNOME Infrastructure Team 2018-05-02 19:06:58 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/912.