On my debian unstable system, recently updated, xfce4-panel eats an approximately constant 2% CPU time. Stracing the program showed that within about 10 seconds, it called the following functions: > grep -c ioctl strace.log 142 > grep -c gettime strace.log 267 > grep -c poll strace.log 141 > grep -c time strace.log 360 It appears the panel is polling something rather inefficiently, and rather often. Removing the system load monitor plugin from the panel didn't make any difference. My panel (vertical, right side, only one active) contains the following items: XFCE menu (closed) 8 application launchers pager (3 pages) system load monitor mixer plugin clock action buttons (logout, lock) system tray (empty) iconbox I don't recall the CPU usage from the previous 4.2 version I had installed, but I am not certain. I can't easily test this as I am not familiar with downgrading a package in debian, but I will gladly help if required.
Created attachment 673 Strace log (approx. 10 seconds) of my xfce4-panel process. This is the strace log described in the bug report.
Created attachment 674 Set clock timeout This small patch sets the clock update interval from 1/10 sec (default) to 1 second. This saves a lot of widgets redraws.
(In reply to comment #2) > This small patch sets the clock update interval from 1/10 sec (default) to 1 > second. This saves a lot of widgets redraws. That seems to have been the culprit: I haven't tried the patch yet, but if I remove the clock from the panel the CPU usage of xfce4-panel drops to 0. I will try the patch as soon as possible.
He Jasper, there is a check_signal_state timeout in panel-app.c. It this really needed?? since it's triggered 4 times per second. If you stop this timeout and remove the clock, there is no strace activity when the panel is idle. Maybe where is a way to improve this. Greets, Nick
(In reply to comment #4) > He Jasper, > > there is a check_signal_state timeout in panel-app.c. It this really needed?? > since it's triggered 4 times per second. If you stop this timeout and remove > the clock, there is no strace activity when the panel is idle. Maybe where is a > way to improve this. I believe I read an alternative implementation on the gnome lists that use a pipe and a IO watch (there's something in glib for this) and when a signal arrives a byte is written to the pipe. Perhaps that would be better?
You can use dbus, but this might be a bit overkill for a panel. Anyway if you apply the clock patch first, there will be some cpu time saved.
Ok, this should be fixed in SVN revision 22748. It would be nice if you could verify this.
When idle there is one strace string each second (even without panel clock), but that shouldn't be a big problem.