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

perf: use diesel_async and improve queries #102

Merged
merged 9 commits into from
Dec 27, 2023

Conversation

lajp
Copy link
Member

@lajp lajp commented Dec 18, 2023

Diesel has some issue on complex queries and therefore we have to rely on multiple queries in some cases.

Regardless of that this is still a massive improvement on the current implementation.
For example the endpoint /users/@me/leaderboards is sped up roughly by a factor of 37.

before:

image

after:

image

The performance of /friends/list is also drastically improved.

@lajp lajp linked an issue Dec 18, 2023 that may be closed by this pull request
@lajp lajp mentioned this pull request Dec 20, 2023
@lajp lajp marked this pull request as ready for review December 20, 2023 19:25
@lajp lajp requested a review from DrVilepis as a code owner December 20, 2023 19:25
@lajp
Copy link
Member Author

lajp commented Dec 20, 2023

This is now ready for review.

src/database/friends.rs Outdated Show resolved Hide resolved
Co-authored-by: Eetu Mäenpää <[email protected]>
src/database/auth.rs Outdated Show resolved Hide resolved
src/database/auth.rs Outdated Show resolved Hide resolved
Copy link
Member

@DrVilepis DrVilepis left a comment

Choose a reason for hiding this comment

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

lgtm (?)

@lajp lajp merged commit 6239da7 into Testaustime:main Dec 27, 2023
4 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.

Make proper use of diesel::associations
3 participants