[PR2 Bug] race chat killing performance
#1
everyboidy was complaiongin to me about pr2 lag so i ran adobe scout with pr2 open and played some traps with the boyz and i found the source of the lag. it's the race chat.

to any players who want to know how to avoid this lag for the time being: do not type at all in the chat, or at least minimize the chatting and message length


[Image: ogwZdhO.png]

i confirmed this by going alone into a campaign map and u can see the performance hit if u spam some ish in chat (max message text) and the lag is exaggerated if u move ur character around. see 52% of the frame time is spend updating text layout! it's being updated every frame--even if the chat doesn't change.

i located the exact line that causes this issue: the line in RaceChat.ensureBottom(), this callback is called twice per frame, and the line can safely be removed for a 50% performance boost (in my case, although it managed to get up to 70% when standfing still) during a maxed out chat.

to be specific it's the setting of the .htmlText that triggers the recalculation of the text layout. i see what you meant to do here, you wanted to set text scroll to bottom and just reused the showMessages() function. i'd put scroll to bottom code directly inline in the ensureBottom handler, or you can listen for the CHANGE event on the textboxes and set scroll to bottom there (cleaner imo).


on a related note text is kinda expensive to draw so there is more performance to be gained by having the ability to hide the race chat completely, or making messages expire after some time
The Following 7 Users Say Thank You to oxy For This Useful Post:
  • Atari4600, bi3liu, bls1999, ExplosionZ, JEEJAYEM, Magniloquent, Shocker14


Messages In This Thread
race chat killing performance - by oxy - 19th February 2021, 3:05 PM
RE: race chat killing performance - by bls1999 - 19th February 2021, 8:37 PM
RE: race chat killing performance - by TRUC - 19th February 2021, 11:47 PM
RE: race chat killing performance - by bls1999 - 20th February 2021, 2:30 AM
RE: race chat killing performance - by bls1999 - 20th February 2021, 5:04 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)