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

[chore] update database caching library #1040

Conversation

NyaaaWhatsUpDoc
Copy link
Member

Updates to use result.Cache{} as the database caching library, which reduces need for boiler plate code, and allows for caching of negative results.

The caches themselves will be a bit less performant than previous iterations due to the use of reflection, and having to stringify any generic key type, and internal cache ordering / size limits (a requested feature). But more than made up for by the caching of negative database results, so no need to recheck values of known non-existent keys. And again, configurable size limits!

Configuration of the cache size limits will come at a later date.

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc force-pushed the update-caching-library-used branch 2 times, most recently from 5c6f911 to 33eb0f0 Compare November 14, 2022 22:12
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc marked this pull request as ready for review November 14, 2022 22:19
@NyaaaWhatsUpDoc
Copy link
Member Author

This has been running on k.iim.gay now for over 24hrs without issues :)

Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Copy link
Contributor

@tsmethurst tsmethurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Largely looks very nice :) Just a couple queries

internal/api/client/status/statuscreate.go Show resolved Hide resolved
internal/db/bundb/tombstone.go Show resolved Hide resolved
internal/db/bundb/user.go Show resolved Hide resolved
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc merged commit 8598dea into superseriousbusiness:main Nov 15, 2022
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.

None yet

2 participants