-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabled text wrapping on TextEdit node causes low perfomance #36287
Comments
I wonder if the high CPU usage is just due to the amount of draw calls. Support for 2D batching is being worked in #35957. |
As well as the need for batching in the renderer as Calinou says, there may also be a problem in the way the text boxes calculate layout and cull (or don't cull) characters that are off screen. Before it even gets to the renderer the text boxes should be:
I've not looked at any of the text widgets but I'm pretty sure (2) is not working correctly for some of the nodes. |
@grotar00 for now you can use the |
I had another little test with this, it is approx 9x faster with batching in debug (should be faster in release) but I can't see any obvious option in the node to cull out the text that is not on screen, either with this or with label. There is a 'clip' option in label but it doesn't speed things up, it probably just activates glScissor. So although the batching will hide it, it really should be solved within the nodes themselves imo. |
Seems still valid in 3.2.4 beta4 |
Godot version: 3.2.stable.official
OS/device including version: Windows 10 x64
Issue description: I suppose everything is just the way it is, but this was quite unexpected source of lag for my text processing app. Perfomance decrease depends on (string length / node width) ratio and gets worse if text is selected.
Gif below demonstrates CPU (left column) and GPU (rightmost column) usage (RAM is middle).
Can it be because line splits of entire string are calculated every frame? Is it possible to freeze the node unless it has focus or text is changed?
Steps to reproduce: Paste text (>10k symbols) to TextEdit node with true wrap_enabled.
Minimal reproduction project: Text Wrap Test.zip
The text was updated successfully, but these errors were encountered: