Unbloat queststatus table + Improve character save performance - #348
Open
nutnnut wants to merge 1 commit into
Open
Unbloat queststatus table + Improve character save performance#348nutnnut wants to merge 1 commit into
nutnnut wants to merge 1 commit into
Conversation
getQuest() inserts a NOT_STARTED QuestStatus into the quest map on any lookup and never evicts it. On save, every such placeholder is written to queststatus, then reloaded on login, so the table grows without bound with rows that carry no real state. Skip persisting NOT_STARTED entries that have no forfeit count, no recorded progress, and no medal maps; they are recreated lazily by getQuest() on demand. Forfeited and progress-bearing rows are kept. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nutnnut
marked this pull request as ready for review
June 29, 2026 09:33
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.
Description
Current:
queststatus table bloated by rows that simply says "not started", these amount to ~2300 useless rows of delete+insert everytime a character is saved
saving characters takes a long time(relatively, if i have 400+ bots in my server it takes forever(several minutes) to stop/restart) about 1-2 save per second on my machine
Proposed:
Dont put those useless rows in DB, consequently dont reinsert them every saves.
Result:
Much faster save time, very apparent if you have hundreds of characters online and have to restart. 3-4 saves per second on my machine
Checklist before requesting a review
Screenshots