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

controllers/summary: Use tokio::try_join!() to perform database queries in parallel #10082

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Nov 26, 2024

Similar to #9663, this PR changes our GET /api/v1/summary endpoint to perform various SQL queries in parallel.

In local testing this brought the average response time from around 100ms down to 80ms 🎉

Unfortunately, the encode_crates() calls currently still need to be a separate step, since we can't keep hold of the &mut conn across await points when we're sharing the connection... or at least I haven't found a way yet 🤷‍♂️

Related:

@Turbo87 Turbo87 added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works A-backend ⚙️ labels Nov 26, 2024
@Turbo87 Turbo87 merged commit f532e24 into rust-lang:main Nov 27, 2024
8 checks passed
@Turbo87 Turbo87 deleted the pipelined-summary branch November 27, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant