Spell Check very slow and causes UI to become unresponsive
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
.NET Version: I tried this with .Net Framework 4.5.2, 4.7.2, 4.8 and .Net (Core) 6.0.
Windows version: Windows 11
Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
Hi,
The spell checking is really slow in our Application (.Net 4.7.2) and causes the UI to become unresponsive and essentially unusable until the spell check is complete. This affects both the text box and the rich textbox.
To investigate this I created a simple test project with a single textbox with spelling enabled (SpellCheck.IsEnabled="True") bound to a string property. At start-up I load the string property with text and the problem is observed. Once the spell check has finished the UI becomes responsive again.
The problem seems worse the more misspelt words there are in the text and the longer the text is (tested with "Lorum Ipsum" text). It is also made worse if there are multiple text boxes/rich text boxes with spelling enabled on the same window (as is the case in our actual application).
My colleague claims to have also observed high CPU, but in my testing CPU was around 8% (laptop with Core I9 & 32GB). I wonder whether it is more to do with the UI thread being blocked.
I tried the switch: AppContext.SetSwitch(@"Switch.System.Windows.Controls.DoNotAugmentWordBreakingUsingSpeller", true); but this didn't seem to make much, if any, difference.
I know it's a completely different beast, but I did some testing with the same text in Word and of course it was very responsive. This appears similar to #3350.
This has been reported by our customers.
Thanks
Contributor guide
Assessment
This issue has not been assessed yet.