perf(main): debounce synchronous file writes to reduce main thread blocking#11
Draft
monotykamary wants to merge 1 commit intoSuperCmdLabs:mainfrom
Draft
perf(main): debounce synchronous file writes to reduce main thread blocking#11monotykamary wants to merge 1 commit intoSuperCmdLabs:mainfrom
monotykamary wants to merge 1 commit intoSuperCmdLabs:mainfrom
Conversation
…ocking Add write debouncing (100ms) to frequently modified stores: - clipboard-manager: debounce saveHistory() calls - snippet-store: debounce saveToDisk() calls - memory: debounce writeLocalMemories() calls - settings-store: debounce OAuth token saves + add saveSettingsAsync() Move directory creation to startup to avoid repeated fs.existsSync checks: - clipboard-manager: ensureClipboardDirs() on monitor start - snippet-store: ensureSnippetsDir() on init Reduces blocking I/O during rapid clipboard operations and frequent snippet modifications.
monotykamary
commented
Feb 18, 2026
Contributor
Author
monotykamary
left a comment
There was a problem hiding this comment.
Although logically sound (and not much to break here), there does need to be a performance harness for us to validate it instead of vibe testing it.
Contributor
I will look into performance testing tools today. will test these changes manually for now. Thanks! |
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
Some quick wins to avoid that "freezing" feeling when opening the clipboard history on top of the other things. Adds write debouncing to reduce blocking I/O operations on the main thread during frequent clipboard and snippet operations.
Changes
Debounced Writes (100ms)
saveHistory()- batches clipboard history writessaveToDisk()- batches snippet modification writeswriteLocalMemories()- batches memory writessaveSettingsAsync()for non-blocking settings writessaveOAuthTokens()for OAuth token persistenceDirectory Creation Optimization
fs.existsSync+mkdirSynccalls from hot paths to startup:clipboard-manager:ensureClipboardDirs()called once on monitor startsnippet-store:ensureSnippetsDir()called once on initImpact
Testing