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

Skip render if output is unchanged #44

Closed
kj800x opened this issue Jan 21, 2020 · 1 comment · Fixed by #45
Closed

Skip render if output is unchanged #44

kj800x opened this issue Jan 21, 2020 · 1 comment · Fixed by #45

Comments

@kj800x
Copy link
Contributor

kj800x commented Jan 21, 2020

Similar to #31, but this is an even simpler case.

If the function logUpdate is called multiple times with the exact same input, the second call can return early and skip the re-rendering task.

In our experience, adding this short-circuiting logic in our render loop reduced the CPU usage of the iTerm process from 11-15% to 0.1% when output is unchanging.

@sindresorhus
Copy link
Owner

Good idea 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants