Skip to content

Unbloat queststatus table + Improve character save performance - #348

Open
nutnnut wants to merge 1 commit into
P0nk:masterfrom
nutnnut:fix-queststatus-notstarted-bloat
Open

Unbloat queststatus table + Improve character save performance#348
nutnnut wants to merge 1 commit into
P0nk:masterfrom
nutnnut:fix-queststatus-notstarted-bloat

Conversation

@nutnnut

@nutnnut nutnnut commented Jun 29, 2026

Copy link
Copy Markdown

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

  • [ x] I have performed a self-review of my code
  • [x ] I have tested my changes
  • I have added unit tests that prove my changes work

Screenshots

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
nutnnut marked this pull request as ready for review June 29, 2026 09:33
@nutnnut nutnnut changed the title fix: stop persisting NOT_STARTED quest-status placeholders Unbloat queststatus table + Improve character save performance Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant