Repository navigation
perf(paste): paste about 136 ms sooner and stop blocking on YOLO Return - #3084
Merged
Merged
Conversation
…aster, and stop blocking on YOLO Return - Lazy settle gate shared by macOS and Linux: a paste returns once its key goes; only the next clipboard change waits out the rest of 100 ms. - Skip the clipboard snapshot while the last paste's restore still holds the user's clipboard; never read unfulfilled file promises. - 3 ms between Cmd+V events in local apps, 15 ms kept for remote desktop, screen sharing, VM clients, and unnamed apps. - YOLO Return waits on the output worker's loop instead of a sleep; Escape, another app in front, or a newer job means no Return and History relabels. - History saves records in the background, coalesced, flushed on stop. - Log text_paste_ms, history_ms, and yolo_wait_ms beside paste_ms.
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.
Dictations paste about 136 ms sooner on macOS, and a YOLO dictation finishes when its text lands instead of 500 ms after release.
Every paste used to sleep 100 ms after ⌘V and pace ⌘V's four key events 15 ms apart, and a YOLO send held the output worker through its Escape window. Remote desktop and VM clients keep the slow pacing, and the clipboard restore is unchanged.
❌ Before
history.jsonbefore the dictation finishes.✅ After
📊 Numbers: fixed waits removed per paste, from the code (not measured end to end)
paste_msAlso in this PR:
changeCountguard).paste_mskeeps its name and meaning (the whole output step). New fields:text_paste_ms,history_ms, andyolo_wait_mson "YOLO mode pressed Return".New tests cover settle timing, back-to-back snapshot skip and user-copy preservation, the file-promise guard, local versus remote key gaps, the YOLO deadline, Escape, app-change and cancel paths, and the History relabel and flush.
👀 Read: the output worker loop in
parakeet.rs(recv_timeoutagainst the pending Return, and the cancel on any job) and the deferred save inhistory.rs(syncsaves an unsaved record before any reread, so a reread can never drop one). The rest is routine.From a 48-hour log audit of paste latency · no user reports · Linux and Windows compile through CI
Checks run
scripts/check paste keyboard output_history pending_return yolo_mode history dictation::modes::output correction_watchplus the YOLO, Paste Last and salvage cases inparakeet::tests: 290 passedcargo clippy --locked --bin hex -- -D warnings(macOS): cleanpython3 scripts/code-shape.py: no hard problems