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

Improve async logic on local IO #90

Open
1 task done
geo-martino opened this issue May 30, 2024 · 0 comments
Open
1 task done

Improve async logic on local IO #90

geo-martino opened this issue May 30, 2024 · 0 comments
Labels
enhancement New feature or request local Concerns local module or functionality

Comments

@geo-martino
Copy link
Owner

geo-martino commented May 30, 2024

Description

Currently, the program uses the mutagen package to handling loading audio files and their metadata/properties. However, this package appears to only be able to load files synchronously. As such, loading the metadata from audio files is currently not as optimised as it can be.

Ideally, the program should be able to utilise a package such as aiofiles to handle loading these files and their metadata. The handling of tag data is currently abstracted away to TagReader and TagWriter definitions which are in a hidden scope and the key load APIs exposed to the user are set up to run asynchronously despite the actual logic of these methods running synchronously still. As such, it should be possible to replace the mutagen package without introducing breaking changes to the code.

However, if it is possible to have mutagen load the files asynchronously, this would be preferred. Further research is needed.

Along with this, the loading of playlist files could also be made asynchronous with the aid of aiofiles or another similar package. Currently, while these load functions also operate in an asynchronous context, their logic is also synchronous.

It is a similar story too with LocalLibrary objects and their child classes. This should also be adapted as with playlists to fully complete this ticket.

Use case/motivation

Loading tracks from the system can be one of the slowest tasks to run at present, especially for an entire library. This would be a huge performance boost to one of the key areas of the program.

Related issues

Part of an ongoing drive to improve performance as per #13 and #86

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@geo-martino geo-martino added enhancement New feature or request local Concerns local module or functionality labels May 30, 2024
@geo-martino geo-martino changed the title Implement async logic on local IO Improve async logic on local IO May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request local Concerns local module or functionality
Projects
None yet
Development

No branches or pull requests

1 participant