byobu-status is very CPU-intensive on Mac OS

Bug #1837153 reported by Ryan Thompson
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
byobu
New
Undecided
Unassigned

Bug Description

I noticed that having a terminal open with byobu running was killing my battery life, and eventually I tracked it down to byobu-status taking a ridiculous amount of time to run, almost half a second. Given that the command runs twice per second (tmux_left & tmux_right), this basically means that one CPU core is pegged at 100% just running byobu-status constantly. As a result, my Macbook goes from around 5 watts to over 20 watts, sometimes over 30 watts, and battery life is cut accordingly.

Disabling the status bar has no effect because the offending line is

. "${BYOBU_PREFIX}/lib/${PKG}/include/common"

which happens right before the script exits if status is disabled. Here's an example (with status.disable present):

$ for x in `seq 10`; do time byobu-status; done
byobu-status 0.20s user 0.20s system 80% cpu 0.495 total
byobu-status 0.22s user 0.22s system 82% cpu 0.533 total
byobu-status 0.19s user 0.18s system 81% cpu 0.456 total
byobu-status 0.22s user 0.22s system 80% cpu 0.553 total
byobu-status 0.19s user 0.19s system 82% cpu 0.459 total
byobu-status 0.22s user 0.22s system 82% cpu 0.533 total
byobu-status 0.19s user 0.18s system 81% cpu 0.455 total
byobu-status 0.22s user 0.22s system 82% cpu 0.532 total
byobu-status 0.19s user 0.18s system 82% cpu 0.444 total
byobu-status 0.22s user 0.22s system 80% cpu 0.554 total

Running the same on my linux server tells me that byobu-status runs in about 0.01 seconds there, so this seems to be specific to Mac OS. My Mac OS is 10.14.5, but based on how long I've been having battery life issues, this problem has existed on several previous Mac OS versions as well.

Revision history for this message
Ryan Thompson (rct86) wrote :

I suppose I should mention that byobu is installed via homebrew.

Also, as would be expected, adding "exit 0" as the first line of byobu-status fixes the CPU usage, and obviously gets rid of all status indicators (except date and time, which I guess are handled separately).

Revision history for this message
1nsane (vlad-tkatchev) wrote :

Also affected by this on Macbook Pro 2020.
The timings are similar (0.6-0.7).
However, in my case, the system doesn't even report high CPU usage, but rather CPU temperature rises very quickly to the top together with fans speed maxing out.

Revision history for this message
Jérôme Tremblay (jerometremblay) wrote :

I simply renamed byobu-status to something else. I don't have my status bar but at least byobu us not killing my battery anymore.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.