Disable Electron spellcheck and background throttling - #2
Merged
Conversation
bb is a control plane, not a document editor. Spellcheck walks the DOM on input. Background throttling pauses token streams and query refetch when the window is occluded. Fixes get-bb#2693
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.
Human comments
What was wrong
The desktop shell is Chromium in front of a Node server. Spellcheck walks the DOM on every input event; bb is a control plane, not a document editor. With
backgroundThrottlingon, Chromium pauses timers in an occluded window, so token streams, reconnect, and query refetch stall.Related: get-bb/bb#2693 (Chromium main-thread cost). This PR is the two window prefs we can flip without rewriting input handling.
What changed
webPreferences.spellcheck: falseandsession.setSpellCheckerEnabled(false)on window create and context-menu register.webPreferences.backgroundThrottling: false.No protocol change. Remote-first startup was already correct (a saved Connect / custom URL skips
initializeRuntime) and is not touched here.Why this way
get-bb#2693 is broader (EventTimingProcessingEnd when input events accumulate). Turning spellcheck off removes a known DOM walk on every keystroke. Disabling background throttling keeps the control plane alive when the window is covered. Both are one-line Electron prefs.
We did not try to fix Chromium event-timing itself, and we did not change how the renderer schedules React work. Those are larger cuts.
Benefit to bb
Packaged desktop only. Less main-thread work per keystroke in the prompt box; a covered window still paints incoming tokens. Web is unchanged.
Harvest
Independent. Already opened: get-bb/bb#2934.
Decision record: docs/perf-control-plane.md (PR #9).
How you verified
apps/desktop/test/desktop-window-factory.test.tsanddesktop-context-menu.test.tsexpectspellcheck: false,backgroundThrottling: false, andsetSpellCheckerEnabled(false). 17 passed.Related: get-bb#2693, get-bb#2934