Bitbar: BitBar process has a constant CPU usage (of ~1%) even when idle

Created on 22 Jan 2018  路  2Comments  路  Source: matryer/bitbar

Platform: MacOS 10.13.2
Version: 1.9.2

Given BitBar with 2 plugins installed with a refresh interval of 10 minutes each
Then the BitBar expected CPU usage should be 0% during the idle time
And should raise only when the 10 minutes elapse.

Current implementation of BitBar has a notable impact on the battery usage.

ps

Most helpful comment

I built the current code and ran it through Instruments, and nothing looked obviously wrong. Most time is spent system calls on the Main Thread:

  • NSApplication, 75% of the time

    • CFRunLoop, 60%

    • Observers, 25%

    • Timers, 20%

    • Queue, 15%

I had a quick look through the code and I have seen slightly better CPU usage by changing:

https://github.com/matryer/bitbar/blob/master/App/BitBar/ExecutablePlugin.m#L80
from
DISPATCH_QUEUE_PRIORITY_DEFAULT
to
DISPATCH_QUEUE_PRIORITY_BACKGROUND

Feel free to try that and report back?

All 2 comments

Any updates to this? I'm noticing this as well. Why is CPU so high for an idle bitbar?

I built the current code and ran it through Instruments, and nothing looked obviously wrong. Most time is spent system calls on the Main Thread:

  • NSApplication, 75% of the time

    • CFRunLoop, 60%

    • Observers, 25%

    • Timers, 20%

    • Queue, 15%

I had a quick look through the code and I have seen slightly better CPU usage by changing:

https://github.com/matryer/bitbar/blob/master/App/BitBar/ExecutablePlugin.m#L80
from
DISPATCH_QUEUE_PRIORITY_DEFAULT
to
DISPATCH_QUEUE_PRIORITY_BACKGROUND

Feel free to try that and report back?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

reteps picture reteps  路  5Comments

insiderq picture insiderq  路  10Comments

alesf picture alesf  路  7Comments

Wondermagicman picture Wondermagicman  路  4Comments

phaistonian picture phaistonian  路  4Comments