Skip to content

WPF TextBox stutters on update  #5887

Open

Description

  • .NET Core Version: 6.0.100
  • Windows version: 19044.1387
  • 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

Problem description:
The attached example WPF application has a number of System.Windows.Controls.TextBox instances that are updated each 100ms when the "Go" button is pressed.

image

The Go button starts an update of the value Data bound to all TextBox:es according to:

image

The UI freezes quite quickly although I have ample of system resources:

Processor Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz 2.90 GHz
Installed RAM 64,0 GB (63,8 GB usable)
System type 64-bit operating system, x64-based processor

During net framework era we have employed a trick that adds memory pressure and garbage collects "all the time" so that a bug garbage collect that seems to cause the freeze does not need to happen. This however is not a good long term solution:
(The "solution" was initially described in http://connect.microsoft.com/VisualStudio/feedback/details/376495/wpf-sporadically-slow-textbox-text-anystring that is no longer available. )

image

This can be tested by checking the checkbox "UseUglyMitigation" in the first image.

Repro by running the attached application.

WpfTextBoxPerfIssue.zip

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

Metadata

Assignees

No one assigned

    Labels

    PerformancePerformance related issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions