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

avoid pessimistic busy render loop #4

Merged
merged 1 commit into from
Jun 3, 2019
Merged

Conversation

wez
Copy link
Contributor

@wez wez commented Jun 3, 2019

I noticed that running sp < README.md would spin 100% cpu for both sp
and my terminal emulator. I ran this down to this bit of code,
which would force a full screen render every 100ms.

What seems to work for me is making this only return a Refresh
action if there is a pending refresh.

I noticed that running `sp` would spin 100% cpu for both `sp`
and my terminal emulator.  I ran this down to this bit of code,
which would force a full screen render every 100ms.

What seems to work for me is making this only return a Refresh
action if there is a pending refresh.
@wez
Copy link
Contributor Author

wez commented Jun 3, 2019

To reproduce this, run sp < README.md then press space. The busy loop only kicks in after the first keypress.

@markbt
Copy link
Owner

markbt commented Jun 3, 2019

Thanks!

@markbt markbt merged commit 88a58fb into markbt:master Jun 3, 2019
@wez wez deleted the busyrender branch June 3, 2019 15:02
wez added a commit to wez/streampager that referenced this pull request Jun 3, 2019
forgot to do this as part of markbt#4
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