Instead of walking the old grid cell-by-cell, and checking for tracking points, OSC-8 URIs etc on each cell, memcpy() sequences of cells.
For each row, find the end column, by scanning backwards, looking for the first non-empty cell.
Chunk the row based on tracking point coordinates. If there aren’t any tracking coordinates, or OSC-8 URIs on the current row, the entire row is copied in one go.
The chunk of cells is copied to the new grid. We may have to split it up into multiple copies, since not all cells may fit on the current "new" row.
Care must also be taken to not line break in the middle of a multi-column character.
On my laptop, average reflow time is reduced from 32599 μs to 22614 μs, for a full 16K scrollback, with lots of OSC-8 URIs.
Without hyperlinks, the new average reflow time is 14553 μs.
Part of #504
Instead of walking the old grid cell-by-cell, and checking for tracking points, OSC-8 URIs etc on each cell, `memcpy()` sequences of cells.
For each row, find the end column, by scanning backwards, looking for the first non-empty cell.
Chunk the row based on tracking point coordinates. If there aren’t any tracking coordinates, or OSC-8 URIs on the current row, the entire row is copied in one go.
The chunk of cells is copied to the new grid. We may have to split it up into multiple copies, since not all cells may fit on the current "new" row.
Care must also be taken to not line break in the middle of a multi-column character.
On my laptop, average reflow time is reduced from 32599 μs to 22614 μs, for a full 16K scrollback, with **lots** of OSC-8 URIs.
Without hyperlinks, the new average reflow time is 14553 μs.
Part of #504