Bug 210345 - very slow switching with random playing by track and large playlist
Summary: very slow switching with random playing by track and large playlist
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 2.3-GIT
Platform: Gentoo Packages Linux
: LO wishlist
Target Milestone: 2.3.1
Assignee: Amarok Developers
URL:
Keywords:
: 213094 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-12 18:35 UTC by tuupic
Modified: 2010-03-23 21:16 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tuupic 2009-10-12 18:35:21 UTC
Version:           2.2 (using KDE 4.3.2)
OS:                Linux
Installed from:    Gentoo Packages

I have a very large playlist, about 7000 tracks.
I use random playing by track.
When I press "next track/previous track/pause/stop" amarok is freezing for 1 - 10 seconds.
I think this is the bug. Other players switches immediately
Comment 1 Mark Kretschmann 2009-10-12 18:46:22 UTC
Why are you using such a giant playlist? Please consider using a Dynamic Playlist for this task, which can do exactly what you want, and much more.

Also, it will be much faster.
Comment 2 tuupic 2009-10-13 05:24:34 UTC
I need exactly that giant playlist. I need not dynamic playlist. 
I have to use another player, in which no such bugs.
Comment 3 langstr 2009-11-04 15:42:02 UTC
I hit this bug as well.

Mark, I think it was inappropriate to close this bug as "WORKSFORME": the feature in question (large custom-sorted playlist) doesn't work for you either, you simply don't use the feature.

I feel tuupic and I have a *VERY* reasonable desire: play my whole collection in a specific sorting set by me. The random jumble offered by Dynamic Playlist is useless to us.

I would like to ask you to please reopen this bug report, and consider fixing this regression from Amarok 1.
Comment 4 Myriam Schweingruber 2009-11-04 18:36:52 UTC
*** Bug 213094 has been marked as a duplicate of this bug. ***
Comment 5 Myriam Schweingruber 2009-11-04 18:38:00 UTC
Reopening on user request, but this is a wish, so don't expect this to be solved any time soon.
Comment 6 langstr 2009-11-06 13:09:24 UTC
I have found the site of the O(n) performance bug:

Playlist::Model::metadataChanged( Meta::TrackPtr track ) {
    const int size = m_items.size();
    for ( int i = 0; i < size; i++ ) {
        if ( m_items.at( i )->track() == track ) {
            [snip]
            break;
        }
    }
}

Crudely disabling this function fixes the problem.
Comment 7 langstr 2009-12-02 11:10:04 UTC
Note: I've developed a proper fix for this bug, which refactors the PlaylistModel data structure. It also attacks a number of other issues in the ModelStack that I encountered working on this bug. 

A few other demands on my time have come up that hold me from tidying up and submitting the patch. However, contact me before working on this bug.
Comment 8 Myriam Schweingruber 2009-12-02 12:11:10 UTC
(In reply to comment #7)
> Note: I've developed a proper fix for this bug, which refactors the
> PlaylistModel data structure. It also attacks a number of other issues in the
> ModelStack that I encountered working on this bug. 
> 
> A few other demands on my time have come up that hold me from tidying up and
> submitting the patch. However, contact me before working on this bug.

We are in string and feature freeze now anyway. Once you are ready, please submit your patch as a merge request to http://gitorious.org/amarok
You can find more information here: http://techbase.kde.org/Getting_Started/Sources/KDE_git-tutorial
Comment 9 Teo Mrnjavac 2009-12-03 11:41:07 UTC
I would be very much interested in reviewing your work. If you have any questions or require assistance with ModelStack stuff don't hesitate to contact me here or in #amarok on irc.freenode.org as Teo`.
Comment 10 Teo Mrnjavac 2009-12-23 13:14:52 UTC
Any news on this?
Comment 11 langstr 2010-03-23 21:16:48 UTC
The problems causing this have been fixed (by myself). Closing.