Skip to content

fix(rendering): read each font glyph's pixels once instead of per character - #1004

Closed
ugcodrr wants to merge 2 commits into
mainfrom
fix/glyph-cache
Closed

ugcodrr wants to merge 2 commits into
mainfrom
fix/glyph-cache

Conversation

@ugcodrr

@ugcodrr ugcodrr commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Superseded by #1042

Description: Every character on a card read its glyph's pixels from the font atlas, and on skia-canvas 3 each read redraws the whole atlas.

  1. The median card renders 1.83 times faster, and a BedWars card goes from 165 to 86 ms.
  2. chore(deps): update skia-canvas to v4 #1001 makes these reads cheap on its own, so once it lands this saves about 1 ms per card.

Merge order for the perf PRs is in #1002.

Testing: render any profile on main and here. The PNGs are byte for byte the same.

…racter

getImageData on a font atlas rasterises the whole atlas, and fillCharacter called it for
every character drawn, which was most of a card's render time. Each renderer now keeps a
glyph's ImageData after the first read, keyed by the character, and drops them when its
atlases are reloaded. The pixels are only read, never changed, so output is identical.
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
statsify Ignored Ignored Oct 22, 2026 4:30am UTC

@ugcodrr

ugcodrr commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

Superseded by #1042, which now has these glyph-cache changes and the per-row drawing in one PR against main

@ugcodrr ugcodrr closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant