mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-11 17:41:02 +00:00
* Row auto-fit: sweep merges once per sheet instead of per row auto_row_height() picked the merges touching a row by scanning every merge on the sheet, and opening a workbook (fit_imported_rows) or a commit fitting many rows called it per row, so rows x merges comparisons ran synchronously on open. Rows are fitted in ascending order, so a MergeSweep sorts the sheet's merges by first row once and keeps only those active on the current row. All comparisons count against MERGE_FIT_WORK (50,000,000) per pass; past it the remaining rows keep the heights they have. auto_row_height keeps its signature for single rows. * address review: share the merge-comparison budget across the whole auto-fit pass * address review: build the merge sweep lazily, after the row fast paths * address review: charge the merge sort to the fit budget, keep row heights once it is spent * address review: a pass that fits one row scans the merges instead of sorting them