Replies: 2 comments 1 reply
-
|
@beetbox/maintainers would someone mind having a look? |
Beta Was this translation helpful? Give feedback.
-
|
I'm not sure I follow your suggestion. In beets core, all HTTP requests go through the That said, In practice, parallelizing requests inside a single plugin often doesn't make sense due to API rate limits. Besides, plugins are already free to use whatever HTTP framework they want for their own requests 🤔 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I had been using httpx for api requests in beets-vocadb. But since it hasn't had a new release since December 2024, I began looking for alternatives. At first, I considered it's recent fork httpxyz, but it doesn't seem to be compatible with httpx-retries, so I went for niquests instead. While reading the documentation, I found out it has supports a multiplexed connection. Using that, I was able to implement batch id lookups in beets-vocadb despite the API not natively supporting it. See the these commits for the relevant changes.
before:
after:
In my implemtation, there's still some overhead because in certain cases, additional individual requests need to be sent, but it's still a pretty significant improvement. Now, I wish the same was implemented in other plugins too, especially the lyrics plugin, which seems to be the main bottleneck while importing.
Beta Was this translation helpful? Give feedback.
All reactions