perf: replace polling loop with event-driven waiting for process output - #9
Closed
Danthewaann wants to merge 7 commits into
Closed
Danthewaann wants to merge 7 commits into
Danthewaann wants to merge 7 commits into
Conversation
Danthewaann
force-pushed
the
improve-output-rendering-speed
branch
6 times, most recently
from
August 10, 2026 09:10
fd81f01 to
f4ae4d8
Compare
Danthewaann
force-pushed
the
improve-output-rendering-speed
branch
from
August 10, 2026 09:11
f4ae4d8 to
926a479
Compare
Danthewaann
force-pushed
the
improve-output-rendering-speed
branch
from
August 10, 2026 10:14
2497a18 to
6c1d402
Compare
Danthewaann
force-pushed
the
improve-output-rendering-speed
branch
2 times, most recently
from
August 11, 2026 16:01
a9b388d to
996ceb6
Compare
Danthewaann
force-pushed
the
improve-output-rendering-speed
branch
from
August 11, 2026 16:07
996ceb6 to
bbccc4f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the fixed
time.sleep(0.1)in the main render loop with an event-driven wait using selectors. Each process's stdout file descriptor is registered with a selector, and the main loop blocks inselect()until either new output is ready to read or a short timeout elapses, instead of redrawing on a fixed interval regardless of whether anything changed.Process output is now read directly on the main thread instead of via a background reader thread per process, since the selector already tells us when there's data available. When a process exits, any output still sitting in its pipe is drained immediately so trailing output written right before exit isn't missed.
Also update the progress spinner so it's update interval is tied to the elapsed time for each process. This means it can still render at a consistent interval since the
time.sleep(0.1)call is gone, which previously gated when it got updated.