GTK4 efficiency and performance in X11 export/remote drawing mode?

I am trying to get an idea about the performance or how gtk4 compares to gtk3 in case of remote rendering (X11) using a “ssh -X” connection.

I am aware of the new “GL” based rendering and some frame rate like updates, but do not know much about the details. I noticed in experiments a message for every window created as GL is not supported via X11 export as far as I know.

Gsk-Message: 20:32:30.911: Failed to realize renderer of type ‘GskNglRenderer’ for surface ‘GdkX11Popup’: Unable to create a GL context

I used some kind of fall back and the windows eventually showed up OK, but it tool a very very long time compared to gtk3 to finally pop up the windows remotely.

Actual “work” with the app was possible even not great. Compared to gtk3 it felt different, may be slower at times. But a main bottle neck seams the window creating and this unfortunate included menu pop-ups as well. Means using a app’s menu is very tedious.

Are there any insights to this? May be some configuration options to adjust for speed optimization when using X forwarding? Disable animations, etc?

What happens when launching GTK4 applications with the environment variable GSK_RENDERER=cairo? Is the speed comparable to GTK3?

That sounds like a great option for X11 forwarding, but still is same slow!
I have a feeling it is falling back to cairo anyways in this remote mode - it seams similar.

The only difference is I do not get the
“Gsk-Message: 20:32:30.911: Failed to realize renderer of type ‘GskNglRenderer’ for surface ‘GdkX11Popup’: Unable to create a GL context”
message any more when setting GSK_RENDERER=cairo.

I compared a few key actions of the gtk3 vs gtk4 version of large but port in progress application for remote operating a microscope.

Here are some numbers on the same remote machine and same connection, actually have both started and side by side to compare.

At startup, it is creating 7 windows with some mixed complexity… but both cases are having exactly the same number and same widgets.

------------    startup  scan   menu        move-objects     dialog  "long"-combo-box pull dn
#windows created:  #7    #1  popup popdn    #1obj            create 
Gxsm3 (GTK3)      ~12s   2s  <1s   instant   near-instant    ~1s     ~1..2s
Gxsm4 (GTK4)      ~40s   8s* ~2s   new-behav. ~2s tor create ~3..4s  ~2..3s

On a local display the startup takes around 1…2s. Everything else is snappy. GTK3 and 4 hard to tell apart.
Both machines have a decent NVidia powered and GL capable graphics (local).

  • “scan” means start a new scan, this opens a window (not bare, has some controls and widgets also) and updates an image (400x400px at the test settings) line by line. On GTK3 the window comes up quick and I see the update top to bottom. For GTK4 the window takes so long to create I only do see the final image.

Note1: The for GTK4 as of my knowledge I can not any more “damage” or set the region to update in a drawing area – previously I efficiently managed to limit the update to the new image data area.

However, on my remote machine I also have to run it via flatpak as only my development system has gtk4 at this time. But Locally it works about normal in sandbox mode.

PS: It’s a little awkward command line, but the only way I found to do this is like after ssh -X to my remote machine via 50/400 MSPS broadband:

flatpak run --filesystem=~/.xauth --command=sh org.gnome.Gxsm4 -c “export DISPLAY=$DISPLAY; export GSK_RENDERER=cairo; cp -p -f ~/.Xauthority ~/.Xauthority ; gxsm4”

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.