madmaxoft / SkauTan

Music player for Skautské Tancování
https://skautske-tancovani.cz/
The Unlicense
1 stars 2 forks source link

Centralize disk IO into a single thread #251

Open madmaxoft opened 4 years ago

madmaxoft commented 4 years ago

Currently, when adding a larger number of songs to the DB, the background threads overwhelm the disk IO queue and may even make the entire app unresponsive for a long time (tens of minutes, even). It'd be much better to centralize and serialize all disk IO bound to adding songs (hashing, tag reading, tempo detection) into a single thread that would read the disk data for each song and then send it to processing.

madmaxoft commented 4 years ago

Slight problem with this: After adding an entire folder, all the song files get read in the memory, but their hash detection is slower than the read rate, thus consuming large amounts of RAM. Would need a dedicated song scan scheduler. However, because there was no noticeable improvement in GUI reactivity, this entire task has been abandoned for now.