Skip to content

Text drawing allocates highlighter and decoration collections on every recording #25412

Open

Description

@MartinZikmund

What would you like to be added? 💡

UnicodeText.Draw should only allocate its per-recording collections when they are needed. Today every text recording allocates them, whether or not the text uses them:

  • a highlighter RangeSlicer, whose segment list is all most text uses
  • empty collections for text decorations, decoration lines, spell-check underlines and composition underlines

Why is this needed? 🤔

Text is re-recorded as items scroll into view and whenever a TextBlock is invalidated. On a 1,000-tile GridView, these allocations are a measurable share of the per-frame allocations during scrolling.

For which platforms 📱💻🖥️

Skia (all heads)

Anything else we need to know? 💬

Found while profiling GridView scrolling for #25389.

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

Metadata

Metadata

Assignees

Labels

area/performancekind/enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions