! 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-terminal v0.6.3 (Gentoo build): a task running in an out-of-focus tab e...
Status:
RESOLVED: FIXED
Product:
Xfce4-terminal
Component:
General

Comments

Description sphakka 2015-07-08 19:05:43 CEST
I'm seeing a strange behaviour with xfce4-terminal v0.6.3 (Gentoo build): whenever a task runs in an out-of-focus tab of the same terminal window, its CPU load is much higher wrt to the load it has when its tab is in focus. 

Always reproducible. Steps:

1) open at least two tabs in a Terminal;
2) start a task on one tab with enough load to see it in a meter like gkrellm, f.i.:

'$ while true; do echo -ne "blah blah blah blah\r"; done'

(depending on the CPU power and message length, the mileage may vary)

3) observe the CPU load increasing when the tab is switched.

My system is dual-core. Terminal is configured with a a Terminus font and aliasing disabled. I use nvidia-drivers v304.125 with xorg-server v1.16.4 on a GeForce Go 6150 GPU.

The same test with mrxvt shows no load difference when the tab is switched. I also don't remember of having ever seen this problem on a KDE Terminal.

Original Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=497424
Comment 1 Egmont Koblinger 2016-10-28 09:30:33 CEST
I'm not sure it's a bug, and not sure which case is the "correct" one.

And endless loop is supposed to drive your system at 100%, no matter if bash producing the data of xfce4-terminal consuming this data is the bottleneck (it's sure the latter) -- of course it's more complicated than that in a multitasking environment and with a multicore/multithread CPU but the basis of the story is the same.

When the tab is not visible, your shell runs in an endless loop plus vte (xfce-terminal's terminal widget) has to handle this data. When the tab is active, vte also needs to display this data, and so your X server, video card etc. all join the game. So this should not be a  surprise that the performance differs between two cases. Chances are that the higher CPU load in an invisible tab is caused by more data being processed, since there's no need to update the UI. And don't ask why processing data spins the CPU more than updating the display :)

The fact of a CPU load increase on its own doesn't tell anything. Seeing actual numbers (e.g. what does "abnormal" mean?), combined with how many times "blah blah" is printed in either case, could allow us to do some maths. But there's still not much point as long as the system is functioning correctly.

Also note that the brand new gtk3 version might have changed the situation.
Comment 2 Igor editbugs 2016-10-28 11:48:18 CEST
Egmont, thanks for stepping in :)
Comment 3 sphakka 2016-10-28 22:18:00 CEST
@Egmont, gotcha! 

Of course, generally speaking, the more I/O there's to be done ("blah, blah"), the less the CPU is loaded, hence the apparently odd behaviour when the tab is hidden: no rendering => less I/0 => more chances for the CPU to spin happily doing (almost) nothing! Shame on me, I should be sent back to OS classes ;-)

Indeed, With the latest xfce4-terminal-0.8.0 (which depends on vte-0.44.2) the rendering looks faster and smoother so the difference is less pronounced than before. The proof? Running a no-op loop like

    $ while true; do :; done

shows no macroscopic difference in CPU load.

I guess this issue should be marked as fixed -- sorry, too lazy to check what the tracker policy is, so I let you do that.
Comment 4 Igor editbugs 2016-10-29 08:07:18 CEST
sphakka, thanks for the update.
Closing.

Bug #12056

Reported by:
sphakka
Reported on: 2015-07-08
Last modified on: 2016-10-29

People

CC List:
2 users

Version

Attachments

Additional information