perf(clipboard): make history writes async#511
Closed
JustYannicc wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
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.
Summary
Before / After Evidence
node --test scripts/test-clipboard-history-persistence.mjsreported[clipboard-baseline] rapidAdditions=100 syncWrites=100 serializeMs=3.23 writeMs=25.38 blockingMs=28.61 finalBytes=17372 sourceSaveCalls=10 historyWriteFileSyncSites=1.[clipboard-after] rapidAdditions=100 coalescedWrites=1 serializeMs=0.05 writeMs=0.33 blockingMs=0.38 finalBytes=17372.Validation
node --test scripts/test-clipboard-history-persistence.mjsnode --test 'scripts/test-*.mjs'\n-./node_modules/.bin/tsc -p tsconfig.main.json --noEmit\n-node /opt/homebrew/lib/node_modules/npm/bin/npm-cli.js run build:main\n- Codex LSP diagnostics onsrc/main: 0 errors\n-node scripts/check-i18n.mjsexited 0; existing Italian locale gaps remain (settings.ai.whisper.vocabulary,settings.extensions.appSearchScope)\n\n## Risks\n- If an async save fails, the queue logs the error and leaves history dirty for a later retry, matching the old non-throwing behavior while avoiding main-process sync I/O.\n- Normal app quit may briefly defer while a pending clipboard write drains; updater restart flushes beforequitAndInstall.