Skip to content

perf(sidebar): reload only the changed outline rows and scope the catalog per connection - #4334

Merged
datlechin merged 3 commits into
mainfrom
perf/sidebar-outline-updates
Nov 19, 2026
Merged

datlechin merged 3 commits into
mainfrom
perf/sidebar-outline-updates

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • P35: drop catalogGeneration from DatabaseTreeRenderInputs. The outline now compares what it draws by value, across every field of a row.
  • P35: a catalog change reaches NSOutlineView as removeItems, insertItems and reloadItem on the rows that changed. A whole reload stays for a layout switch, a forced wake and a row that moved between parents.
  • P35: rows that kept their place keep their nodes, which skips rebuilding their ids.
  • P35: DatabaseTreeNodeCache finds a selected table's rows through an index, and drops rows no rebuild has listed for 8 passes.
  • P35: SidebarViewModel filter caches key on the rows, because side lists commit before the catalog generation moves.
  • P35: external schema names now wake the outline.
  • P36: ConnectionSidebarCatalog publishes one connection's sidebar state. SidebarView, DatabaseTreeView, SidebarTreeView, SidebarSchemaFilterBanner, SchemaPickerControl and FavoritesTabView observe it in place of the service singletons.

Measured in the test host, flat layout, one expanded section:

17,000 tables 50,000 tables
Rebuilds per load with a changed row, before (audit) 3 3
Rebuilds per load with a changed row, after 1 1
Rebuilds per load with identical rows, after 0 0
One full reload on a new list, before 48.1 ms 140.2 ms
One row added, after 17.6 ms 49.6 ms
Comparing identical rows in new buffers, after 10.8 ms 31.2 ms
Selection lookup, after (audit scan: 5.6 to 5.8 ms at 50,000 nodes) 0.05 ms 0.05 ms

Test plan

  • DatabaseTreeReconcileTests, DatabaseTreeRowChangeTests, ConnectionSidebarCatalogTests and SidebarViewModelMultiSectionTests cover row changes, selection, expansion, rename, node sweep and connection scoping. Nine reconcile cases fail with the mechanism reverted.
  • Updated on purpose in DatabaseTreeReconcileTests: ownTablesReload is now ownTablesChangeRows, and recentTableReloads is now recentTableAddsItsSection, since neither change calls reloadData any more.
  • 486 cases across the sidebar, schema service and view model suites pass.
  • SidebarTableTabUITests and TemporaryTableSidebarUITests pass on a real build.

@datlechin
datlechin enabled auto-merge (squash) November 18, 2026 23:43
@datlechin
datlechin merged commit 39a8546 into main Nov 19, 2026
11 checks passed
@datlechin
datlechin deleted the perf/sidebar-outline-updates branch November 19, 2026 01:57
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