samwho / spacer

CLI tool to insert spacers when command output stops
https://github.com/samwho/spacer
MIT License
853 stars 9 forks source link

high cpu usage... #7

Closed mikeggh closed 1 year ago

mikeggh commented 1 year ago

My usage: cd /var/log/apache tail -F error.log|spacer -a 30

It ends up with a core being 99%... an strace only shows a blocking read() on the process..

I figured i'd report.. not sure if for some reason high cpu usage is necessary..

samwho commented 1 year ago

High CPU usage is definitely not expected. Could you show me a screenshot of where you're seeing this high CPU use?

mikeggh commented 1 year ago

Sorry for edit/close/reopen.. browser issues w this net connection... shot

mikeggh commented 1 year ago

It seems to have lowered some, only 10%/5% per core for each.. shot2

mikeggh commented 1 year ago

It seems to have lowered to 1.7% and 0.6%, which is personally acceptable.. thank you sir for your work..:> always nice to find new utilities to help after 20yrs of devops:>

samwho commented 1 year ago

There was a bug eating up CPU! I found it and fixed it in https://github.com/samwho/spacer/pull/9. Thanks for reporting! v0.1.8 should include the fix. Please reopen this if it doesn't fix it.