I do see a small increase in CPU usage (both xfdesktop and Xorg), but the same happens when placing and moving the mouse cursor over Thunar or Mousepad.
While my hardware is not powerful (it's a dual core thin client) this is still an order of magnitude worse than e.g. Windows. After all, XFCE "aims to be fast and low on system resources". I am willing to help profile this but I'll need some directions as to preferred instrumentation.
On AMD E1-6010 (AMD Mullins 1.4GHz Dual-Core) with Xfce XFWM4 v4.13.1 with compositing ON on Fedora 30 beta I found that
Booting into Xfce & opening a terminal with top has Xorg using 4%.
Moving the mouse in circles above xfdesktop brings Xorg up to 10.5% and xfdesktop to 10%.
Opening thunar and moving the mouse in circles above the file list area brings Xorg to 30% and Thunar to 15% CPU usage. This seems high.
Moving the mouse in circles above empty space below the devices/places/network left side-bar area has CPU usage at 9% for Xorg and 4% for thunar
Moving the mouse in circles above the populated part of the sidebar and the icon toolbar brings CPU to to 40% for Xorg and 25% for thunar
For comparison, playing APink's %% musicvideo coded as x264 at 720p with mpv using vaapi hardware decoding & terminal window with top above that has Xorg using 20% and mpv 15% CPU. That's less CPU used than what's used when moving the mouse in circles above the top part of the sidebar and the icon toolbar.
I typed dnf -y update on that slow old outdated laptop which was weak to begin with so I won't be able to do further testing for hours.
On AMD E1-6010 in the ultimate window-manager fluxbox which I used when the Pentium II was hot technology moving the mouse in circles on the background uses 3.3-4% CPU by Xorg. This doesn't change after loading a wallpaper with xloadimage -onroot wjsn.jpg.
Starting thunar with a terminal running top visible below and
moving the mouse fast in circles on devices/places/network side uses 20% Xorg, 25% Thunar
moving the mouse fast in circles above the file listings uses 25% Xorg, 30% Thunar
moving the mouse fast in a circle covering the icon toolbar, sidebar and file listing uses 25% Xorg, 30% Thunar
While somewhat irrelevant it's data-points of interest. Moving the mouse in circles above the wallpaper in XFCE4 used 10.5% CPU by Xorg and 10% by xfdesktop which is double the Xorg CPU usage (xfdesktop can't be compared to fluxbox because fluxbox doesn't really care what's going on in the root window).
the thunar CPU usage figures are high and in the same ball-park regardless of fluxbox or xfwm4.
dolphin in fluxbox:
moving the mouse fast in circles on the places/remote/search for sidebar puts Xorg at 15%, dolphin at 20%
moving the mouse fast in circles above the file listing makes Xorg use 20%, dolphin 35%,
moving the mouse fast in a circle covering the icon toolbar, sidebar and file listing results in 23% Xorg use, dolphin 35%.
It looks like the usage for thunar is barely higher than dolphin (just tested because Qt/KDE differs from GTK).
Not sure there is too much XFCE developers could do about what appears to be Xorg and GTK/Qt toolkit overhead.
As for use-case.. I can't say I've ever rapidly moved the mouse in circles above an application like I did for this testing during any kind of work or entertainment.
JM, any news on this issue? We need to know if the behavior is specific to xfdesktop or Xfce in general. Based on the test results from Öyvind we have to assume that Xorg is to blame.
I would like to try and profile this to see where it spends most of the cpu time but I don't know what's the preferred way to do it (perf, gprof, valgrind?)
Sadly, I am not familiar with performance analysis tools. Any data would be helpful, especially when compared to other applications like Thunar, Mousepad, and so on.
I installed Xfce 4.14 PPA on Xubuntu Disco and am testing it, I have noticed that moving the mouse does increase CPU load on all programs. The computer I'm testing now has a Intel Core i3-6100U and Intel HD Graphics 520.
(The values below are approximated)
htop shows that moving the mouse over a program window increases the program total CPU load by around 0,8% and Xorg CPU load increases by 0,3% too. This was noticed on all programs I tested, including programs not exclusive to Xfce4, as Audacious and Tilix.
While I was able to get a Mousepad backtrace showing its actions while moving the mouse, the CPU load increase is the "normal" CPU load increase for all programs.
For xfdesktop, however, the increase is closer to 1,3% CPU load and Xorg load 2%. The gdb backtrackes while the mouse is being moved have data related to the mouse movement much more often than other programs.
Thunar does have 2% CPU usage if moving the mouse quickly over icons and the "normal" CPU load when not over icons. Xorg CPU usage increases 0,5% when moving the mouse over the icons.
I'm unable to find the debug symbols for the Xfce 4.14 PPA debug symbols, which makes the backtraces a bit incomplete. Where can I find the debug symbols for the Xfce 4.14 PPA?
Attachment 8565, "Compressed file with backtraces from Mousepad, Thunar and xfdesktop while idle and moving the mouse": gdb-bt-mousepad-thunar-xfdesktop.tar.gz
I will try to take a look at this issue (but I cannot promise that I will find some magic optimization lowering CPU/GPU load by 50%). The most recent CPU load data are from 2019-05-21, so they might no longer be valid - can you please redo the measurements [more than one] and post them here?
Note: You are using 4.14.2, so some of the performance issues might not be reproducible with 4.15.
Hm, so with desktop icons enabled, I get around 2.5% CPU usage when rapidly moving the mouse back and forth on the desktop, probably because the icon view widget is checking to see if the pointer has moved over an icon (as it will redraw the icon in a 'hover' state if so). That's annoying, but understandable, because the algorithm for figuring out if the pointer is in an icon's extents is not at all optimal. (I'm not really sure how to make it better, to be honest.)
The weird thing, though, is if I disable desktop icons entirely, I still see around 1.3% CPU usage when rapidly moving the mouse back and forth. I'm surprised there's any at all, since, without desktop icons, xfdesktop isn't monitoring mouse movements at all (aside from whatever GTK itself might be doing).
Interestingly, if I kill xfdesktop and rapidly move the mouse over X's root window, Xorg's CPU usage jumps by about 4%. So clearly that's not an issue with xfdesktop, at least.
The CPU usage with desktop icons might be able to see some improvement, if there's a better algorithm for checking if the pointer is over an icon. But with desktop icons disabled, that's all in GTK's domain, and there's nothing I can do about that. Ditto, obviously, for when xfdesktop isn't even running at all!
@RUSshy do you have desktop icons enabled? Do you see any difference with desktop icons disabled? (Please restart xfdesktop after disabling them to ensure any extra event masks haven't been left over from when the icon view was enabled.)
Another thing to look into, for people who are having this issue: do things change if you disable xfwm4's compositor (in "Window Manager Tweaks" settings)?