dotnet/wpf

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

Open

#6,304 创建于 2022年3月23日

在 GitHub 查看
 (6 评论) (2 反应) (0 负责人)C# (6,683 star) (1,126 fork)batch import
Performancehelp wanted

描述

  • .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.

贡献者指南

TextFormatter.FormatLine has O(n^2) performance when called multiple times · dotnet/wpf#6304 | Good First Issue