Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: performance issue caused by the render calls #23

Merged

Conversation

Md-Cake
Copy link
Contributor

@Md-Cake Md-Cake commented May 30, 2024

mactop has high CPU usage. Running it with cpuprofiling shows that the top CPU time is spent in the termui.Render calls (to be specific, in the ioctl syscalls there).

I removed a bunch of unnecessary Render calls (there were some duplicates) and replaced all the other calls with a throttled version: I call Render in the main process but not more often than twice in the single "update interval" period.

This should address issue #13.

P.S. It's my first contribution to the open-source project in a while, but I couldn't walk past 😊

mactop has high CPU usage. Running it with cpuprofiling shows that the
top CPU time is spent in the termui.Render calls (to be specific, in the
ioctl syscalls there).

I removed a bunch of unnecessary Render calls (there were some
duplicates) and replaced all the other calls with a throttled version: I
call Render in the main process but not more often than twice in the
single "update interval" period.

This should address issue context-labs#13.
@metaspartan
Copy link
Collaborator

LGTM, great job, thank you!

@metaspartan metaspartan merged commit f745c4e into context-labs:main May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants