Skip to content

Conversation

@simonklee
Copy link
Contributor

Most rendered cells are fully opaque, yet the blending path unconditionally calls get() + blendCells() for every cell.

This adds an opaque check to skip blending in the common case.

For the raw variant, the only caller is the graphemeAware=false branch in drawFrameBuffer, so grapheme chars should never appear. I made this contract explicit by replacing the grapheme fallback with debug asserts, avoiding per-cell overhead in release builds.

@simonklee simonklee force-pushed the buffer-opaque-fast-path branch from 71f414b to 14782a6 Compare January 9, 2026 21:34
Most rendered cells are fully opaque, yet the blending path
unconditionally calls get() + blendCells() for every cell.

This commit adds an opaque check to skip blending in the common
case.

For the raw variant, the only caller is the graphemeAware=false branch
in drawFrameBuffer, so grapheme chars should never appear. I made
this contract explicit by replacing the grapheme fallback with debug
asserts, avoiding per-cell overhead in release builds.
@simonklee simonklee force-pushed the buffer-opaque-fast-path branch from 5102134 to 88b749e Compare January 12, 2026 05:59
@kommander kommander merged commit 20da3b9 into anomalyco:main Jan 13, 2026
4 checks passed
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