dnkl/foot
41
2.0k
Fork
You've already forked foot
242

Text reflow performance #4 #540

Manually merged
dnkl merged 18 commits from chunked-reflow into master 2021年06月04日 07:43:28 +02:00
Owner
Copy link

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
Author
Owner
Copy link

I think this one's pretty much done. Since it's a fairly big change, I'll be running this as my daily driver for ~1 week or so before merging.

I think this one's pretty much done. Since it's a fairly big change, I'll be running this as my daily driver for ~1 week or so before merging.
dnkl changed title from (削除) WIP: text reflow performance #4 (削除ここまで) to Text reflow performance #4 2021年05月26日 22:37:09 +02:00
dnkl added this to the 1.8.0 milestone 2021年05月30日 11:13:11 +02:00
dnkl manually merged commit dd43afd754 into master 2021年06月04日 07:43:28 +02:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/foot!540
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "chunked-reflow"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?