Conversation
_tuish_draw_box_impl wrote the left border, fill, and right border as three separate _tuish_write calls inside the per-row loop, even though all three are loop-invariant. Build the row body once before the loop and emit a single write per row. Output is byte-identical (verified by diffing the rendered buffer across full/partial borders, heavy/double/rounded styles, colors, degenerate sizes, and off-screen clipping). About 20% faster on a box-heavy workload (2000x 10-row boxes: 3.21s -> 2.57s under bash). Unit suites pass on bash/zsh/ksh93/mksh/busybox; the boxes integration test passes 22/22 against the existing .screen fixtures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_tuish_draw_box_impl wrote the left border, fill, and right border as three separate _tuish_write calls inside the per-row loop, even though all three are loop-invariant. Build the row body once before the loop and emit a single write per row.
Output is byte-identical (verified by diffing the rendered buffer across full/partial borders, heavy/double/rounded styles, colors, degenerate sizes, and off-screen clipping). About 20% faster on a box-heavy workload (2000x 10-row boxes: 3.21s -> 2.57s under bash). Unit suites pass on bash/zsh/ksh93/mksh/busybox; the boxes integration test passes 22/22 against the existing .screen fixtures.