Smart Playlists need optimization for large libraries

Bug #1088269 reported by Tristan Davies
34
This bug affects 6 people
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...

Revision history for this message
zinga (zinga) wrote :

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).

Revision history for this message
Corentin Noël (tintou) wrote :

Okay, there is for sure performance improvement that can be done there, it will be the next task on the list.

Changed in noise:
status: New → Confirmed
importance: Undecided → High
milestone: none → luna-beta2
Revision history for this message
Danielle Foré (danrabbit) wrote :

Removing from luna-beta2 milestone. We can definitely do performance enhancements after Luna release. not really a release blocker, imo.

Changed in noise:
milestone: luna-beta2 → none
Revision history for this message
Tristan Davies (tristan.io) wrote :

How about disabling the "Recently Added" default playlist until it is fixed? Since it's largely useless with it enabled (assuming you have more than 1,000 songs). Most users won't be able to figure out how to get it working, instead opting to install... rhythmbox.

I could try to patch that if you think it's a good idea.

Revision history for this message
Corentin Noël (tintou) wrote :

I've set the default smartplaylists to 50 songs, so It should be usable for now (You have to delete the database at ~/.local/share/noise )

Revision history for this message
Corentin Noël (tintou) wrote :

I changed the way smartplaylists are used, they now analyse only the music files that have changed.
I've also changed (again) the default smartplaylists to be more… smart !
So now, It should be fine, please respond if it's not the case this week-end (Noise has to get packaged & upgraded…)

Changed in noise:
status: Confirmed → Incomplete
assignee: nobody → Corentin Noël (tintou)
milestone: none → luna-beta2
Revision history for this message
Corentin Noël (tintou) wrote :

After some test it should be fixed !

Changed in noise:
status: Incomplete → Fix Committed
Corentin Noël (tintou)
Changed in noise:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.