You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(grid): eliminate duplicate 40-row sampling in computeResultGridColumnWidths and distributeResultGridSpareWidth #1349
In lib/features/workspace/grid/grid_column_sizer.dart:
computeResultGridColumnWidths scans up to kSampleRows = 40 rows across all columns to calculate character length bounds (maxRowChars) and column widths.
Immediately afterwards, if distributeSpareWidth is true and remaining spare width is available, distributeResultGridSpareWidth iterates over the exact same 40 rows again to recompute maxRowChars for each column from scratch.
For tables with many columns (e.g. 50–100+ columns), this executes a redundant second pass over the sample rows and repeats string length inspections during initial layout of new query results (#982).
Proposed Solution
Cache or return the computed maxRowChars directly from computeResultGridColumnWidths.
Pass the precomputed sample character lengths into distributeResultGridSpareWidth to avoid re-iterating over the sample rows.
Acceptance Criteria
distributeResultGridSpareWidth reuses the character counts calculated during computeResultGridColumnWidths.
No duplicate row sampling passes during column width calculation.
Activity
ZhuchkaTriplesix commentedon Oct 11, 2026
Done in #1411 (merged into
dev).