Repository navigation
Restore saved desktop windows concurrently - #6550
Merged
Merged
Conversation
Rebuilding the application menu costs about 2-3 ms per refresh, which does not justify a module-level cache and in-place callback swapping. The concurrent saved-window restore stays: it cuts about 60-80 ms per extra window from desktop startup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 3, 2026
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
Scope trimmed to the saved-window restore. The native menu cache was dropped: a menu rebuild measured about 2-3 ms, which does not justify a module-level cache and in-place callback swapping.
What was wrong
Saved-window restoration awaited each window's initial page load before creating the next window, so startup with N saved windows paid N page loads back to back and delayed runtime startup until the last one finished.
Reproduced against main at
3bacfac9ed69d42392076e5b3da2815bec822cd8with the real desktop build, 5 saved windows, and a remote server target. Windows were created 80-100 ms apart and all 5 showed the bb app at 790-1094 ms after launch (3 runs).What changed
restoreSavedWindowsstarts every saved window's creation and navigation together withPromise.all, keeping the returned windows in saved order and the existing empty-state fallback.How you verified
pnpm exec turbo run typecheck --filter=@bb/desktoppasses.pnpm exec turbo run test --filter=@bb/desktop -- test/desktop-window-factory.test.ts test/menu.test.ts: 46 tests pass.Fixes #6541