Potential fix for slow roundstart - #39474
Draft
Inorien wants to merge 1 commit into
Draft
Conversation
Contributor
|
i think there's a pointlessly nested for loop in the role assignment procs you can check for, last i remember. will update with findings if i actually see it again. |
There are a lot of loops that could probably be removed. I was only able to elimate a couple Would be faster to query all players at once (unless memory constraints, then batch). Unfortunately untangling a million loops might be difficult. Good luck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Batches the DB queries at roundstart
Recently there have been issues where the roundstart timer runs down to 0 but then the game doesn't actually start for another couple of minutes. Looking at logs found that all of the time is spent in the character creation loop, which involves one DB query per player. IF the situation is that the lookup round-trip time is slow (e.g. 5 seconds) and doing this once each for 24 players (= 120 sec) then this PR will reduce the lookups to 1 and the total time on a single round-trip (5 seconds) rather than the O(N) stuff we have now. This change only affects the lookups for readied players at round start and has no effect on latejoins
(apparently its generally good practice to batch these types of queries anyway)
If the problem is not the round-trip time but instead the DB itself is slow, for some other reason, this won't have much of an effect at all beyond just allegedly better practices in SQL lookup
In any case I believe this to be an environment issue more than anything
Why it's good
slow round start bad, the Gamers become Upset
How it was tested
it isn't yet. I need to set up this local DB shit to test it properly and its a pain in the ass
Changelog
🆑