branchrust_reboot/main/server_browser_budgetingcancel
3 Commits over 0 Days - ∞cph!
Use a stopwatch to check how long we are taking on the current ServerCacheQuery batch, if over 2ms then yield for the next frame, or continuously allow processing up to 50 elements per time
This (in reality) results in a constant overhead of 4ms until the results are processed rather than a single lag spike. I think its better and can be tuned a bit more in future by just upping the budget
By the time you've click the server browser a few seconds have passed and most of the queue is empty anyway
Drop match ServerInfo creation batch size from 500 to 50, and use Task.Yield() rather than delay
Do the mode parsing inside the ServerInfo single loop itself. This saves us around 15% of total ms cost per server info constructor creation
Ends up saving around 14ms~ when creating a batch of 500 ServerInfos