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

Text reflow performance #2 #520

Manually merged
dnkl merged 2 commits from reflow-performane-no-new-row-initialization into master 2021年05月17日 17:58:03 +02:00
Owner
Copy link

This builds on top of #519

  • Don't zero-initialize the cells of freshly allocated rows
  • Don't zero-initialize the cells of rows re-used from the scrollback
  • Free rows from the old grid one by one "as we go", rather than all at once at the end

The first two points directly affect the time it takes to reflow the grid; zero-initializing new rows is completely unnecessary since they'll immediately get overwritten. There are two exceptions to this: one, rows with a hard line break. Here we need to "manually" clear the remaining cells when we insert the line break. Two, the last row may only be partially written. Here too, we need to clear the remaining cells.

The last point reduces our memory foot print, as we no longer need to hold both the old and the new grid, in their entirety, in memory at the same time. May also improve performance due to slightly better cache behavior (but I doubt it).

This builds on top of https://codeberg.org/dnkl/foot/pulls/519 * Don't zero-initialize the cells of freshly allocated rows * Don't zero-initialize the cells of rows re-used from the scrollback * Free rows from the old grid one by one "as we go", rather than all at once at the end The first two points directly affect the time it takes to reflow the grid; zero-initializing new rows is completely unnecessary since they'll immediately get overwritten. There are two exceptions to this: one, rows with a hard line break. Here we need to "manually" clear the **remaining** cells when we insert the line break. Two, the _last_ row may only be partially written. Here too, we need to clear the **remaining** cells. The last point reduces our memory foot print, as we no longer need to hold both the old and the new grid, in their entirety, in memory at the same time. _May_ also improve performance due to slightly better cache behavior (but I doubt it).
dnkl force-pushed reflow-performane-no-new-row-initialization from d8905cf758 to 7731f4b4a4 2021年05月16日 18:49:42 +02:00 Compare
dnkl changed target branch from reflow-performance to master 2021年05月16日 18:49:58 +02:00
dnkl force-pushed reflow-performane-no-new-row-initialization from 7731f4b4a4 to 1aa4a31c6f 2021年05月17日 17:57:44 +02:00 Compare
dnkl manually merged commit ed60c66522 into master 2021年05月17日 17:58:03 +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!520
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "reflow-performane-no-new-row-initialization"

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?