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

feat: Use async requests to retrieve SteamGridDB covers #991

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

adamantike
Copy link
Collaborator

This change avoids blocking requests when retrieving covers from SteamGridDB, which is the main bottleneck as the current implementation iterates over paginated results for multiple games.

Using an asynchronous client like httpx provides a good performance improvement, and reduces the latency when calling this endpoint. Also, the inclusion of FastAPI lifespan allows instantiating a single client on startup.

When testing with "Final Fantasy V Advance", the endpoint goes from ~9s to ~1.5s to retrieve all covers.

This change avoids blocking requests when retrieving covers from
SteamGridDB, which is the main bottleneck as the current implementation
iterates over paginated results for multiple games.

Using an asynchronous client like `httpx` provides a good performance
improvement, and reduces the latency when calling this endpoint.
Also, the inclusion of FastAPI `lifespan` allows instantiating a single
client on startup.

When testing with "Final Fantasy V Advance", the endpoint goes from ~9s
to ~1.5s to retrieve all covers.
@zurdi15
Copy link
Member

zurdi15 commented Jul 10, 2024

Dude this is awesome! I just tested it and it flies! Thank you very much for your impressive contributions

@zurdi15 zurdi15 merged commit 7590fd3 into rommapp:master Jul 10, 2024
3 checks passed
@adamantike adamantike deleted the feat/use-async-requests-for-sgdb branch July 10, 2024 11:43
@adamantike
Copy link
Collaborator Author

Glad to see the project evolving! Thank you for the continuous support and great application

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.

2 participants