[Bug] [UWP] [Performance] Editor with autosize property is very slow
#13,097 opened on Dec 10, 2020
Description
Description
Performance when using the Editor control on UWP with the autosize property set is incredibly slow. Typing individual letters or pasting text becomes noticeably unperformant.
Steps to Reproduce
- Create an editor and set autosize on it
- Fill the editor with lots of text
- Try typing or pasting content in it. In my opinion, it becomes unusable with a small amount of text.
Expected Behavior
Editor performs well for a larger amount of text. I don't think anyone expects an infinite amount of text, but the editor currently gets very bad very quickly.
Actual Behavior
Entering text into an editor slows down dramatically the more text that is entered. I've also experienced general issues with the autosizing where it can interfere with other layouts on the page and cause them to display wrong (I feel like the more complex your layout, the worse the performance can be). A simple layout with a text editor has performance issues too.
Basic Information
- Version with issue: 4.8.0.1687
- Last known good version: N/A
- Platform Target Frameworks:
- iOS:
- Android:
- UWP: 19041
- Android Support Library / AndroidX Version:
- NuGet Packages:
- Affected Devices: i5-4690k
Screenshots
I have created a video to demo the issue. The first editor uses auto size. The second editor uses a fixed height and no auto size. Both editors start with 5 paragraphs of lorem ipsum. The test I do is hold down a key on my keyboard for a few seconds and then I hold down Ctrl + V to repeatedly paste a line of text. An editor without auto size can hold magnitudes more text and remain responsive. The autosize editor feels like it loses performance exponentially as more text is added. https://www.youtube.com/watch?v=K7aaRRLb7FU
Reproduction Link
<Editor AutoSize="TextChanges" />
Workaround
Unfortunately, using a fixed height editor is the only solution I've found. This solution isn't great as it means wasted space or the text will overflow beyond the editor with no indication that there is more text to see.