Skip to content

Slow DirectWrite text rendering with many TextColor range attributes #390

Open
@ForLoveOfCats

Description

@ForLoveOfCats

Piet version: 0.3.2 (as pulled in by Druid, Windows tests built with linebender/druid@b40a363)
Reproduction: https://gist.github.com/ForLoveOfCats/0919bbb3df3eb122f97fd07e79fd501a

In the above code the "normal" text renders between ~3 to ~6 ms on my Win10 system (Ryzen 5 3500U mobile APU, fully updated OS at time of writing) while the line with many TextColor range attributes takes between ~30 to ~50 ms to render. For comparison the Pango powered Linux text PR renders the "normal" text in 0 ms and the text with many range attributes in ~2 ms (different machine, Ryzen 3 3200G w/R7 360).

While the render time for the marked up text is exceedingly bad it also appears that the normal text rendering is also rather slow when compared to Pango at the very least (I don't have access to a Mac to test the CoreText backend)

Metadata

Metadata

Assignees

No one assigned

    Labels

    perfperformance related issuepiet-direct2dissue in the direct2d backendtext

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions