Long text in multiline word wrapped entries causes massive performance issues #5297
Open
2 tasks done
Labels
unverified
A bug that has been reported but not verified
Checklist
Describe the bug
Text entry will cause a UI to become unresponsive for large periods of time when
.Multiline = true
and.Wrapping = fyne.TextWrapWord
. This is always on initial use of the entry but it might be happening in other cases.How to reproduce
Easy to demonstrate, create a fyne app where the content is a scroller with a multiline entry and .Wrapping set to fyne.TextWrapWord. See code example with details and nuance.
Screenshots
Desktop.2024.12.03.-.19.44.01.13.DVR_nm.mp4
Example code
Fyne version
v2.5.3-rc1 and v2.5.2 at least
Go compiler version
1.23.3
Operating system and version
Windows 10
Additional Information
At 8K characters it can take upwards of 40 seconds to set the content of a window with this entry inside of a scroll. It gets worst from there and you can easily change the example program to experiment.
This is the cpu profile at 8K characters. cpuprof.zip
A non trivial amount of time is spent in runtime slicerunetostring, but the majority seems to be throughout glDriver RenderTextSize stack and the harfbuzz algorithm.
In this video the first ~37 seconds waiting for it to load after calling .SetContent on the window. It also shows flickering/slowness of the program quickly trying to resize the width of the window containing a large entry. I am unsure if the resize slowness and flickering is related given the initial load takes so long.
The text was updated successfully, but these errors were encountered: