dotnet/wpf

TextFormatter.FormatLine has O(n^2) performance when called multiple times

Aberta

#6.304 aberto em 23 de mar. de 2022

 (6 comentários) (2 reações) (0 responsável)C# (1.126 forks)batch import
Performancehelp wanted

Métricas do repositório

Stars
 (6.683 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

  • .NET Core Version: .net 6
  • Windows version: 11
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
  • Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? no

Actual behavior:

TextFormatter.FormatLine has O(n^2) performance

Expected behavior:

TextFormatter.FormatLine exhibits linear performance

Minimal repro: WpfFontRepro.zip

Remarks

Disposing the formatted lines or creating new TextFormatter instances prevents the O(n^2) behavior.

Guia do colaborador