Taking screenshot is very slow
This is quite significant and was like that for few years now, but it is not good, and on Wayland there is not many other options than gnome-screenshot for taking screenshots under Gnome / Wayland.
Running from command line, total time to do a screenshot (single monitor, 3840x2160), takes 1.1 seconds or more.
user@debian:~/Pictures$ time gnome-screenshot
real 0m1.119s
user 0m0.569s
sys 0m0.047s
user@debian:~/Pictures$ time gnome-screenshot
real 0m1.149s
user 0m0.552s
sys 0m0.060s
user@debian:~/Pictures$ time gnome-screenshot
real 0m1.132s
user 0m0.560s
sys 0m0.054s
user@debian:~/Pictures$ time gnome-screenshot
real 0m1.127s
user 0m0.545s
sys 0m0.061s
It boggles mind that it takes more than 50-100ms.
Similar when using interactive GUI, especially final PNG saving step seems to be taking way too much time.
Doing stracing
shows that just to load all the executable / library, it takes minimum of 100ms (I am on tmpfs, with gazillion of memory, so this is not disk or file system issue). Then it loads a lot of other things, even if run from command line, like all the cursors from a cursor theme, etc.
Finally, it does create a temporary png, then reads it back, then recompresses it and writes it back again. This is likely to support "effects" (like window shadow, etc), but if not used, the file should be just renamed on file system to the final destination.
I am attaching the strace
output of the main gnome-screenshot
thread
gnome-screenshot-strace.txt.zst
This is just screenshot of terminal with empty content, so it should be very easy to compress. (final png final is 65kB).
gnome-screenshot 41.0-2, from Debian testing. amd64. AMD Threadripper 2950x. amdgpu.