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

FR: Multithreaded library synchronization #1711

Open
romner-set opened this issue Sep 30, 2023 · 1 comment
Open

FR: Multithreaded library synchronization #1711

romner-set opened this issue Sep 30, 2023 · 1 comment

Comments

@romner-set
Copy link

romner-set commented Sep 30, 2023

Description
At the moment, php artisan koel:sync uses a simple foreach loop to iterate through all songs and add them to the database, occasionally stopping to update the progress bar. This can take quite a long time on large libraries no matter the hardware involved (my 50k FLAC song library takes upwards of 40 minutes to scan for the first time with a 7950X3D, even when stored on a Samsung 980 PRO with memory_limit set to 8192M). I think this could be improved if the work was split up into multiple threads that run simultaneously.

Making 1 thread per song would probably be excessive for large libraries, and since the CPU usage while scanning is very low I don't think 1 thread per CPU core would make much sense either, though that can only really be verified by testing.

Example
N/A

@romner-set romner-set changed the title Multithreaded library synchronization FR: Multithreaded library synchronization Oct 1, 2023
@phanan
Copy link
Member

phanan commented Dec 28, 2023

PR welcomed.

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

No branches or pull requests

2 participants