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

writer thread #1104

Merged
merged 10 commits into from
Nov 7, 2022
Merged

writer thread #1104

merged 10 commits into from
Nov 7, 2022

Conversation

willmcgugan
Copy link
Collaborator

An experiment that uses a thread to write to stdout.

I discovered that writing to stdout was surprisingly slow. Some writes were in the order of 20ms. I suspect because it includes the time the terminal took to update the display.

Doing the writes in a thread makes them non-blocking, and allows us to work on the next frame at the same time.

src/textual/app.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@davep davep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of questions about how we should document things, really.

@willmcgugan willmcgugan merged commit 7c9e7d6 into main Nov 7, 2022
@willmcgugan willmcgugan deleted the thread-writes branch November 7, 2022 11:37
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.

None yet

3 participants