Repository navigation
perf: fix N+1 IPC, SQLite WAL, batch settings - v3.1.0 - #9
Merged
Merged
Conversation
Performance: - Add PRAGMA journal_mode=WAL + synchronous=NORMAL + busy_timeout to SQLite init - eliminates fsync per write (~10-50ms each) - Add get_all_settings command - replaces 11 sequential IPC calls with a single batch read on app startup - Add set_settings_batch on db.rs - wraps multiple writes in a single SQLite transaction (used by save_blocker_settings) - Parallelize profile ping with Promise.all instead of sequential await loop Version bump to 3.1.0
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
synchronous=NORMAL+busy_timeout=5000on init - eliminates ~10-50ms fsync per write that was causing noticeable UI lag on every toggle/setting changeget_all_settingsbatch command - replaces 11 sequential Tauri IPC round-trips (one per setting key) with a single call on app startupset_settings_batchwith SQLite transaction - wraps content blocker saves (6 writes) in one transaction instead of 6 individual commitsPromise.allinstead of sequentialfor...ofawait loopRoot cause
Every
invoke("set_setting")triggered a separate SQLite write withPRAGMA synchronous=FULL(default), causing a full disk fsync (~10-50ms). With 11 settings loaded sequentially on startup and 6 written per blocker save, the cumulative delay was noticeable. Language/theme changes triggered re-renders that cascaded into these slow paths.Test plan