Repository navigation
Conversation
datlechin
marked this pull request as ready for review
November 23, 2026 05:57
datlechin
enabled auto-merge (squash)
November 23, 2026 05:57
This branch has not been deployed
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
Perf audit 2026-11-22b, grid-tabs lane (findings 6 and 7: G1, G2, G3, G4a).
NSTableColumns get a plainNSCellasdataCell. The default text field cell tiled the table on every attach, so attaching n columns was O(n²): 203 frame changes for 200 columns, now at most 10.reconcileColumnsleaves it to its callers, which refresh after the sort indicators.DataGridHeaderView.resetCursorRectsadds divider rects for the columns on screen only, with AppKit's geometry and cursors. AppKit's pass added one for every column on every scroll step.isFlippedgetters in the app arenonisolated, so the Swift 6 executor check no longer runs in every coordinate conversion. New SwiftLint ruleflipped_view_getter_isolationkeeps it.DataGridRowView.isOpaqueis true while the row draws its own opaque background; an even row fills its stripe once.DataTabGrid) applies aDataTabGridPresentationnamed by its tab.onChangeran the closure of the body from before a switch and wrote the incoming tab's configuration into the outgoing tab's model, which rebuilt that grid's columns again on return..claude/rules/data-grid.md: one line each for the header cursor rects, the data cell and the presentation.Measurements
Release builds, base
9d0d481cf1(build/TablePro.app) against this branch, interleaved, same harness (ui-responsiveness --quick). Medians, n in brackets. Other lanes were building: load1 median 37 (base) and 30 (branch), range 8 to 65. Instruction counts are the metric to read; main ms moves with load.tabcols.switch.to_wide500.procMinstr(500-column tab switch)tabcols.switch.to_wide500.mainMstabcols.switch.to_cols7.procMinstrgrid.scroll.wide500.procMinstr(8,000 px fling, 500 columns)grid.scroll.wide500.mainMsgrid.scroll.typical1M.procMinstr(7 columns)resize.typical1M.procMinstr/resize.wide500.procMinstrtabs.lldb.reconcileColumns.perSwitch(20-tab ring)tabs.switch.procMinstrTime Profiler, main-thread samples in a 10 s window around one fling:
-[NSTableHeaderView resetCursorRects], wide flingDataGridHeaderView.resetCursorRects(0.3%)isFlippedgetters, 7-column fling-[NSTableRowView isOpaque], 7-column flingDeliberately not fixed here
tabs.lldb.gridInit.perSwitchis still 1.0.structure.openandstructure.backare unchanged within noise.Test plan
DataGridHeaderCursorTests(new): rects and cursors equal a recording stockNSTableHeaderViewat min width, at max width, fixed, hidden and with resizing off; 500 columns scrolled to the middle add the visible columns plus one.DataGridPaneTests: mounting 200 columns resizes the table at most 10 times (203 with the default cell, checked by reverting it); a default sort direction change keeps the headings, tooltips and labels.DataGridColumnMetadataTests: metadata that adds an accessory still reaches the header.DataGridBodyChromeTests: row view opacity follows its drawing path; full alpha in both appearances over a translucent stripe and under a row tint; same pixels as the two-step fill, also over a stale table background and a translucent theme background.DataTabGridPresentationTests(new): B's presentation leaves A's model alone; equal rules never repaint; a rules change repaints once; rules changed while hidden repaint on return; a hosted A to B to A switch keeps each model's configuration.override var isFlippedandoverride internal var isFlipped.