! 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 !
xfce4-panel eats a constant 2% cpu time, due to polling?
Status:
RESOLVED: FIXED
Product:
Xfce4-panel

Comments

Description Hein Zelle 2006-07-23 00:24:22 CEST
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.
Comment 1 Hein Zelle 2006-07-23 00:25:28 CEST
Created attachment 673 
Strace log (approx. 10 seconds) of my xfce4-panel process.

This is the strace log described in the bug report.
Comment 2 Nick Schermer editbugs 2006-07-23 20:58:50 CEST
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.
Comment 3 Hein Zelle 2006-07-23 21:44:39 CEST
(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.
Comment 4 Nick Schermer editbugs 2006-07-27 19:22:46 CEST
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
Comment 5 Jasper Huijsmans editbugs 2006-07-28 17:46:54 CEST
(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?

Comment 6 Nick Schermer editbugs 2006-07-29 15:54:47 CEST
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.
Comment 7 Jasper Huijsmans editbugs 2006-08-13 17:42:18 CEST
Ok, this should be fixed in SVN revision 22748. It would be nice if you could verify this.
Comment 8 Nick Schermer editbugs 2006-08-13 20:12:26 CEST
When idle there is one strace string each second (even without panel clock), but that shouldn't be a big problem.

Bug #2056

Reported by:
Hein Zelle
Reported on: 2006-07-23
Last modified on: 2010-11-20

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Attachments

Strace log (approx. 10 seconds) of my xfce4-panel process. (32.74 KB, text/plain)
2006-07-23 00:25 CEST , Hein Zelle
no flags
Set clock timeout (465 bytes, patch)
2006-07-23 20:58 CEST , Nick Schermer
no flags

Additional information