! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
High CPU usage when moving the mouse cursor
Status:
RESOLVED: MOVED
Product:
Xfdesktop
Component:
General

Comments

Description JM 2019-04-20 18:05:41 CEST
Created attachment 8429 
Xorg.0.log

Moving the mouse cursor in circles result in 30% CPU use by xfdesktop and 20% use by Xorg

Graphics stack:

kernel 4.19.27
xorg-server 1.20.3
xf86-video-amdgpu 18.1.0
mesa 18.3.6

Attaching:
glxinfo -B
dmesg
Xorg.log
Comment 1 JM 2019-04-20 18:06:07 CEST
Created attachment 8430 
glxinfo -B
Comment 2 JM 2019-04-20 18:08:30 CEST
Created attachment 8431 
dmesg
Comment 3 Theo Linkspfeifer editbugs 2019-04-20 19:00:10 CEST
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.
Comment 4 JM 2019-04-20 20:32:12 CEST
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.
Comment 5 Öyvind Saether 2019-04-20 21:18:20 CEST
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.
Comment 6 Öyvind Saether 2019-04-21 01:41:59 CEST
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.
Comment 7 Theo Linkspfeifer editbugs 2019-04-28 17:07:03 CEST
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.
Comment 8 JM 2019-04-28 19:51:43 CEST
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?)
Comment 9 Theo Linkspfeifer editbugs 2019-05-03 10:26:15 CEST
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.
Comment 10 leozinho29_eu 2019-05-21 18:01:49 CEST
Created attachment 8565 
Compressed file with backtraces from Mousepad, Thunar and xfdesktop while idle and moving the mouse

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?
Comment 11 Git Bot editbugs 2020-05-26 00:32:43 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org'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.xfce.org/xfce/xfdesktop/-/issues/46.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #15309

Reported by:
JM
Reported on: 2019-04-20
Last modified on: 2020-05-26

People

Assignee:
Xfce Bug Triage
CC List:
3 users

Version

Version:
4.13.3

Attachments

Xorg.0.log (23.23 KB, application/octet-stream)
2019-04-20 18:05 CEST , JM
no flags
glxinfo -B (1.68 KB, text/plain)
2019-04-20 18:06 CEST , JM
no flags
dmesg (48.09 KB, text/plain)
2019-04-20 18:08 CEST , JM
no flags
Compressed file with backtraces from Mousepad, Thunar and xfdesktop while idle and moving the mouse (5.18 KB, application/gzip)
2019-05-21 18:01 CEST , leozinho29_eu
no flags

Additional information