Repository navigation
send output in batches and add it once a frame, so a program printing a lot no longer freezes the studio - #159
Merged
Merged
Conversation
Collaborator
Author
|
Correction to the description above: the freezes in irrl's log were not caused by output. Both follow a clangd restart, and the cause is the backend's recursive file watch on Linux; that is fixed in #161. This PR still fixes a real stall when a program floods the Output panel, reproduced and guarded by |
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.
Your log from the freeze shows the backend going silent right after Run: at 13:24–13:25 in window 2 ("test"), Repair IDE's 5 s ping timed out and it restarted the backend. I reproduced it with a program that logs like a game, printing 40 lines every 2 ms. On main, the backend's ping took up to 11.4 s (median 71 ms), only 5 pings in 8 s were answered, and the Output panel grew to 2.9 million characters.
There were two causes:
What changed
src/output-stream.ts). What builds and runs print is sent every 50 ms as one message, with stdout and stderr in the order they came.outputSkipped,outputTrimmed) are in English, Turkish and French.Tests
tests/output-stream.test.mjs(unit test): one message per interval, order kept, split characters whole, flush, half-finished lines held back, prompts shown, the limit and the note's count, and a 2 MB build arriving whole.tests/e2e/flows/output-flood.mjs(new e2e flow): builds and runs a real program. It prints like a game's log, then as fast as it can for 3 s. The flow checks that:It is skipped without CMake and a C++ compiler; GitHub's Ubuntu runners have both. On main, this flow froze the page until the runner's 240 s limit. On this branch it passes in about 8 s, also with the page's CPU slowed 4×. Writing it found a real bug before this was pushed: a "lines left out" note stuck onto a half-finished line.
Measured:
electron-forge package), both programstsc,lint,npm test, and all 25 e2e flows pass on macOS.Worth knowing
src/output-history.ts.engineCheckout33 s andcheckPluginUpdates49 s with a 14.5 s ping, right after clangd restarted) happened with nothing running. It is not explained by this, and this PR does not claim to fix it.🤖 Generated with Claude Code