Skip to content

perf: skip column width calculation when saved layout exists#532

Merged
datlechin merged 1 commit intomainfrom
perf/skip-column-width-calc
Mar 31, 2026
Merged

perf: skip column width calculation when saved layout exists#532
datlechin merged 1 commit intomainfrom
perf/skip-column-width-calc

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • calculateOptimalColumnWidth() samples 30 rows per column to estimate width. During column rebuild, this ran for EVERY column even when the user had saved column widths that would immediately overwrite the calculated values.
  • Now skips the calculation when columnLayout.columnWidths is non-empty, using saved widths directly. For a 50-column table, this eliminates 50 x 30 = 1,500 cell reads on every column rebuild.
  • Applies to both full rebuild (columns changed) and in-place update (initial data load) paths.

Test plan

  • Open a table for the first time (no saved layout) — columns auto-size correctly
  • Resize a column, switch tabs and back — verify saved width is preserved (no flash of auto-sized width)
  • Open a table with saved layout — should load noticeably faster for wide tables (50+ columns)
  • Delete saved layout (clear column widths) — verify auto-sizing kicks back in

@datlechin datlechin merged commit a42682b into main Mar 31, 2026
2 checks passed
@datlechin datlechin deleted the perf/skip-column-width-calc branch March 31, 2026 07:19
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