WPF TextBox stutters on update
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
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.

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

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

This can be tested by checking the checkbox "UseUglyMitigation" in the first image.
Repro by running the attached application.
[WpfTextBoxPerfIssue.zip](https://github.com/dotnet/wpf/files/7789096/WpfTextBoxPerfIssue.zip)
Contributor guide
Assessment
This issue has not been assessed yet.