Skip to content

Reuse the known width of a text when building spans - #284

Merged
jtdaugherty merged 1 commit into
jtdaugherty:masterfrom
arybczak:reuse-text-widths
Oct 12, 2026
Merged

jtdaugherty merged 1 commit into
jtdaugherty:masterfrom
arybczak:reuse-text-widths

Conversation

@arybczak

Copy link
Copy Markdown
Contributor

Discovered with Claude while working on reprise.

Building the spans of a picture computed the display width and the length of every unclipped text again, character by character, although the image already holds both. Reusing them makes the output faster. In a benchmark that writes whole 160x45 frames, a list with several columns and frames of colored braille characters took 15-16% less time, and a frame in which each row is a single text took half the time.

Building the spans of a picture computed the display width and the length
of every unclipped text again, character by character, although the image
already holds both. Reusing them makes the output faster. In a benchmark
that writes whole 160x45 frames, a list with several columns and frames of
colored braille characters took 15-16% less time, and a frame in which
each row is a single text took half the time.
@jtdaugherty
jtdaugherty merged commit b1772f5 into jtdaugherty:master Oct 12, 2026
0 of 13 checks passed
@jtdaugherty

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants