Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve WidgetUtils.WrapText performance on long lines. #14167
Fixes the performance cliff that caused the freeze in #14141.
The word wrap algorithm was scanning backwards from the end of the string which is horrific for performance when the line of text is hundreds of times longer than the wrap width. Scanning forwards instead places an upper bound on the number of iterations it needs to do before it terminates, fixing the issue and improving perf in the less extreme cases.
Testcase: paste a block of arbitrary text into the chat with and without the change: the results should be the same.
Hey CatGirls420 here. Just letting you know I successfully built the new bleed release and the patch for the anti-spam works. I tested it and could no longer freeze/crash/lag the game by spamming ridiculously large messages (Over 4,000 characters, but i may be underestimating).
So pchote, you're solution seems to have worked. My tests we're successful.