Performance: late previous-playlist load

Nanno Langstraat langstr at
Wed Apr 14 15:24:00 CEST 2010

Something that irks me about starting Amarok is the long delay before 
the MainWindow shows, particularly if you have a large playlist.

When I start Amarok on my "Media" virtual desktop, I can't switch to my 
"Work" virtual desktop to do something useful until MainWindow shows and 
X11 locks it to the right virtual desktop. That takes 13 seconds; an 

I did an experiment a while ago where the previous playlist was loaded 
on a QTimer::singleShot() instead of during the constructors.

I think that with a recent patch from Nikil Marathe / Nikolaj, Amarok 
now contains all the patches necessary to do that.

Timings: with my 8000-track playlist, the time for MainWinow to show 
goes from 13 to 3.5 seconds, which is "tolerable" territory.

MainWindow then "freezes" (stays blank) for 9 seconds while it loads the 
playlist, but I'm liberated to do something else.

Could keep the Splash Screen up during that time. Future elaboration: 
load the playlist in a background thread.

Some minor points:

    * The QTimer call needs to go at the end of 'App::continueInit()' in
      If you start the QTimer in PlaylistActions, it triggers too soon.

    * It allows us to get rid of some constructor ordering trickery,
      e.g. forced early init of The::playlistManager().

    * In Dynamic Playlist mode, new tracks will be chosen before
      'restoreDefaultPlaylist()' gets the chance to run.

What do you think of this?


-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Amarok-devel mailing list