Repository navigation
Conversation
…, so terminal echo stops lagging
This branch has not been deployed
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.
Issue for this PR
Closes #65668
Type of change
What does this PR do?
Two Windows waits that every terminal keystroke paid for:
transport/windows.rs):Listener::waitnow blocks withWaitForMultipleObjectson the pendingConnectNamedPipe's OVERLAPPED event and a realWakeevent, up to the caller's timeout. Before, it slept 25 ms (thread::sleep,POLL_INTERVALis removed).Wakeis now a manual-reset event:notifysets it, anddraintests and resets it, as the UnixWakebehaves.service.rs): on Windows the batch takes only what is already queued (a deadline of now) instead ofrecv_deadline(now + 1 ms). That deadline sleeps a whole 15.6 ms timer tick on Windows. Unix keeps its 1 ms batch.timed_outstaysfalseon Windows, so the missed-wake detector stays off, as before.How did you verify your code works?
devserver withopencode-pty0.6.0,cmd.exeat its prompt, 60 keys 40 ms apart, echo timed on the server's terminal WebSocket. p50 51 ms (p95 160 ms, min 32 ms).transport/windows.rs:drainreports and clears anotify.waitsleeps its whole timeout with nothing to report (it used to return after 25 ms).waitreturns at once on a wake and within a second on a connection.rustfmt --checkon the changed files. I have not built 0.6.0 with the patch locally; the Windows job ofcheck-process-daemon.ymlbuilds it and runs the tests.Screenshots / recordings
No picture: latency, measured above.
Checklist