Smart Playlists need optimization for large libraries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Noise |
Fix Released
|
High
|
Corentin Noël |
Bug Description
I recently imported about 20GB of music into noise. The "Recently Added" playlist caused several delays in the program. I'd get a 15 second delay during startup, and a 15 second delay when editing song metadata.
Currently it loops through every single song and checks if the rules match that song. That's slow.
It does this every time any metadata is changed, when playlists are removed, whenever you sneeze, etc.
First of all, in my opinion, there is no reason to compute which songs belong in which smart playlist unless the user is actually opening that smart playlist.
Secondly, instead of looping through each song, the rules should be transformed into an SQL query which is run against the song database. That should make things very fast. Unfortunately, I fear this modification is way beyond my abilities...
Changed in noise: | |
status: | Fix Committed → Fix Released |
I can confirm this. And with an even larger library (e.g. mine with approx. 10.000 songs) this makes Noise totally unuseable because it freezes for like 10 minutes every time (media import, start up, smart playlist editing, etc.).
Converting the smart playlist queries into SQL queries is the only sensible way to fix this (and a lot of freezes caused as side-effects).