perf: skip achievement metric recounts for live player count updates#4860
Open
wescopeland wants to merge 1 commit intoRetroAchievements:masterfrom
Open
perf: skip achievement metric recounts for live player count updates#4860wescopeland wants to merge 1 commit intoRetroAchievements:masterfrom
wescopeland wants to merge 1 commit intoRetroAchievements:masterfrom
Conversation
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.
Addresses RAWEB-1QM.
When a player's unlock count for a game becomes non-zero, we do two different jobs worth of work:
That second step is the slow
player_achievements GROUP BY achievement_idquery from RAWEB-1QM.This PR makes a minor adjustment: for these player count driven cascades, we'll no longer recount every achievement's unlock totals. Instead, we'll use the unlock totals already cached on each achievement's row and just recompute the unlock percentage, unlock hardcore percentage, and weighted points.
In other words, this PR introduces a "fast track" path for when only the player count changes. The "slow track" path (current behavior) is still present for: