When micro profiling our games, we notice PlayerListManager eats up significant heartbeat CPU time.
This can be observed on any device you test on. This occurs regardless of having any leader stats inside of the player instance. And regardless of the PlayerList Core GUI being enabled.
This is a screenshot of the frame time we observed in Drive World. It is taking up neatly 60ms in this single screenshot. Can be observed by joining any server and looking at the heartbeat step breakdown.
In Drive World specifically, each player has a leaderstat folder and 4 IntValues. Each IntValue has a “Priority” int value to set the sort order for the player list. We have observed this being an issue in several other top Roblox games, regardless of if they are using the Roblox PlayerList at all.
Expected behavior
PlayerList should be performant and not take up more time than what the game logic is doing.
Roblox just launched on PS4 (with low FPS) and this script is taking up nearly 2ms per frame. That’s like 10% of the CPU budget being used up by a corescript.
This is essentially malware being forced into every game!
Would like to bump this again, since I see it causing issues every time I run a micro profile on any device I test on. Can we get an official response here?
Tsunami Game is also seeing this. Whenever anyone has a stat change (such as points, which update frequently), it causes thousands of indexes to Player.TeamColor and Team.TeamColor. There are only 3 teams with up to 30 players.
Edit: This one is especially annoying - I can only reproduce the issue in live servers. A live server of 8 players can have frame times of >30ms due to these thousands of indexes because of this while 12 clients in Studio, locking my 8-core CPU to 100%, shows a couple dozen of these TeamColor indexes.
Edit 2: Issue observed in a live server with only 532 players.
Edit 3: Issue observed in a live server, eventually getting down to only me.
This is still happening and performance has not improved. In our game Tropical Resort Tycoon 2 the player list is consistently using up more CPU time than the entirety of the rest of the game.
Yes, we’re still seeing this issue - even in games where the CoreGui PlayerList is disabled and replaced entirely. I see it occur consistently on my Pixel 2XL.
After some extensive testing at various experiences who have the leaderboard enabled, the PlayerList labels that once took up to 1.42ms now take 0.003ms, if a label was even seen (most frames did not contain a debug profiler detriment large enough to label). I would consider that a great improvement in performance.
The circumstances that cause this performance degradation have to do with updating ValueBases under the leaderstats folder. Any consistent updates to leaderstats worsen performance, noticeably more so when players’ positions rearrange on the leaderboard (performance degradation still occurs without that being the case, too).
Before this update, we’ve noticed issues in our tycoon games such as Mining Factory Tycoon and Business Life where player cash is updated very frequently and will often be very large numbers. I don’t have the exact numbers from before, but we commonly saw around 10-15ms labels with some 30ms+. To minimize this we implemented a system that throttles how often the leaderstats are updated to be reflected on the player list.
We just tested the player list in Business Life with the throttling removed, and the improvements are definitely noticeable. There are multiple frames were nothing is updating and reading 0.002ms, and frames where updates happen are as high as 0.3-0.5ms with a few peaks of 1-5ms seen once every few seconds or so.
Given how often we update our leaderstats, this should probably be expected, but these performance improvements are very good overall. For the time being though, we’re going to stick with our throttling system.