Skip to content

perf(quick-switcher): cut the main-thread stalls of opening Open Quickly - #3888

Merged
datlechin merged 3 commits into
mainfrom
perf/3661-open-quickly-reuse
Oct 29, 2026
Merged

datlechin merged 3 commits into
mainfrom
perf/3661-open-quickly-reuse

Conversation

@datlechin

@datlechin datlechin commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Open Quickly keeps its panel and view tree between opens. The next Cmd-Shift-O swaps in a new QuickSwitcherViewModel instead of building an NSPanel and NSHostingController and measuring them at a full-screen proposal.
  • QuickSwitcherPanelController.present takes retainsPanel. Jump to Column, the toolbar switchers and the recent tab switcher still get a fresh panel, released on close.
  • QuickSwitcherPanelView takes its model from the caller, and its loads are keyed by the model, so a swapped model loads on its own.
  • Closing runs QuickSwitcherViewModel.releaseResults(): the hidden model drops its results, stops observing the catalog, and its in-flight loads drop what they bring.
  • The panel's key commands are installed on every update. WindowAccessor installed them only once, which would have left them on the previous model.
  • The sidebar no longer reloads every row when an all-schema table listing lands while its search is empty. DatabaseTreeRenderInputs leaves the listing out without a search, since the outline reads it only under one. Open Quickly requests that listing on Oracle and PostgreSQL, and its landing was a 100 ms-plus turn of sidebar row layout.

Test plan

  • New: QuickSwitcherPanelControllerTests.retainedPanelSwapsItsModel checks that reopening returns the same window, sends Cmd-2 to the new model and releases the old one. QuickSwitcherViewModelTests.releasedModelDropsResults checks that a released model is empty and ignores a later load and search.
  • Unchanged: closingReleasesTheViewModel still covers the non-retained path.
  • Changed on purpose: DatabaseTreeReconcileTests.listingStartingToLoadIsNoChange now passes a search, and checks that a landing with an empty search leaves the inputs equal.
  • Local: the Quick Switcher, DatabaseTree*, HierarchicalSchemaSearch and SidebarOutlineScaffold suites (361 tests) pass; lint clean.
  • Release build with Time Profiler attached against main, 4 opens per fixture. These are the main thread's CPU samples per warm open, at 1 ms each. They were measured on a build of the same panel path before release on close was added:
Fixture main this branch
MySQL 64-82 48-59
PostgreSQL 58-66 38-40
Oracle 80-152 48-66
  • The first open after launch is unchanged, at 114 to 154 samples.
  • Load was 40 to 560 from other sessions' builds and VMs, so wall-clock times are not comparable.
  • Manual probe: a search field keeps its field editor across the panel's close() and reopen. Setting stringValue while editing keeps editing, so the field still has focus when the panel reopens.

Refs #3661

@datlechin
datlechin enabled auto-merge (squash) October 29, 2026 17:36
@datlechin
datlechin disabled auto-merge October 29, 2026 17:40
@datlechin datlechin changed the title perf(quick-switcher): keep the Open Quickly panel between opens perf(quick-switcher): cut the main-thread stalls of opening Open Quickly Oct 29, 2026
@datlechin
datlechin enabled auto-merge (squash) October 29, 2026 17:52
@datlechin
datlechin merged commit 7cdfa2d into main Oct 29, 2026
8 of 9 checks passed
@datlechin
datlechin deleted the perf/3661-open-quickly-reuse branch October 31, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant