! 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 !
Always polling for change in terminalrc isn't optimal for performance
Status:
RESOLVED: FIXED
Product:
Xfce4-terminal
Component:
General

Comments

Description Adrien CLERC 2007-09-23 08:49:00 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.1.6) Gecko/20070723 Iceweasel/2.0.0.6 (Debian-2.0.0.6-1)
Build Identifier: 

Hi !
I've noticed that Terminal is polling the ~/.config/Terminal/terminalrc every second for changes.

Reproducible: Always

Steps to Reproduce:
Open a Terminal
Open another, launch htop in the last one, go onto the process of the first one, and press the 's' key to strace the process.


Expected Results:  
IMHO, Terminal should use another way to check these file changes. In fact, I'm not really sure it's useful to wait for changes into this file. If a user modify it with an editor, he will be expected to restart Terminal

I'm sure there's a good reason for that (but maybe not ;) ), but this behavior is a performance killer on laptop systems. Moreover, for some tests, I removed that file, and strace always shows me the regular stat64 on that file.
Comment 1 Yves-Alexis Perez editbugs 2007-10-31 13:09:08 CET
I agree with Adrien, polling every second isn't really optimal. Maybe an option would be to poll only once in a while, or maybe use libfam (but it may be a little overkill for a terminal).

Another solution would be to not poll at all and have the user restart the terminal, but he may be confuse if he has to stop all instances.

Maybe yet another solution would be to reload terminalrc when the user make an action (open/close a terminal window or even a tab).

Regards,

--
Yves-Alexis Perez
Comment 2 Yves-Alexis Perez editbugs 2007-11-07 13:30:47 CET
Created attachment 1416 
Patch to only refresh preferences once a minute

This is a quick and dirty patch I'm wondering including in Debian to refresh prefrences once a minute instead of once a second.

Feel free to comment or improve it :)

Regards,

--
Yves-Alexis Perez
Comment 3 Nick Schermer editbugs 2009-06-28 18:12:34 CEST
Fixed in trunk, use gio to monitor the file. There is absolutely no strace output on an inactive terminal window from now on ;-).

Bug #3567

Reported by:
Adrien CLERC
Reported on: 2007-09-23
Last modified on: 2009-12-17

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Attachments

Additional information