Page 1 of 1

Improve performance for setting .text on textfields

Posted: Sat Aug 15, 2020 11:02 am
by Therenas
Currently, setting a large amount of characters on a textfield is slow. Setting textfield.text to a string with ~6000 characters in it takes ~6.5ms according to the ingame profiler. Is there anything that could be done to improve this? I know there might be good explanation for it, I'm just asking. The usecase is creating my own export strings for some data in my mod, which can quickly get in the thousands of characters long.

Re: Improve performance for setting .text on textfields

Posted: Sat Aug 15, 2020 11:41 pm
by Rseding91
Do you have some example mod i can use to test?

Re: Improve performance for setting .text on textfields

Posted: Sun Aug 16, 2020 10:52 am
by Therenas
Sure, made one special for you. Lets you put in a character count and it inserts a string with that size into the textfield. Some more remarks in the code.

Re: Improve performance for setting .text on textfields

Posted: Sun Aug 16, 2020 7:26 pm
by Rseding91
I found a way to make it faster - at least for your specific example.

Re: Improve performance for setting .text on textfields

Posted: Sun Aug 16, 2020 7:36 pm
by Therenas
Great, thanks a lot!