Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[performance] cache more database calls, reduce required database calls overall #3290

Conversation

NyaaaWhatsUpDoc
Copy link
Member

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc commented Sep 12, 2024

Description

  • updates many of the delete-model database functions to instead of preloading the model, delete the model returning the necessary details for cache invalidation and calling the invalidation hook manually
  • updates the list accounts endpoint to use our new style paging logic (needed for cache change below)
  • updates go-structr to v0.8.9 which handles needing to check for an empty slice of uncached keys
  • updates a number of the list entry related database functions to instead rely on more caches
  • consolidates some caches and removes some unused functions

Checklist

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have not leveraged AI to create the proposed changes.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc force-pushed the performance/cache-fiddling branch from 2302396 to c1a220e Compare September 12, 2024 17:35
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc changed the title [performance] cache more database calls, and reduce required database calls overall [performance] cache more database calls, reduce required database calls overall Sep 12, 2024
@NyaaaWhatsUpDoc
Copy link
Member Author

description now accurately described this PR, only thing that needs fixing is updating the list related tests :)

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc marked this pull request as ready for review September 13, 2024 20:48
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc force-pushed the performance/cache-fiddling branch from a1d4e12 to 6bd75b8 Compare September 16, 2024 16:07
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc merged commit 84279f6 into superseriousbusiness:main Sep 16, 2024
2 checks passed
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.

3 participants