dotnet/wpf

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

開放

#6,304 建立於 2022年3月23日

 (6 則留言) (2 個反應) (0 位負責人)C# (1,126 個分叉)batch import
Performancehelp wanted

倉庫指標

星標
 (6,683 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南