Shuffling of large playlists is slow

Bug #1665284 reported by Uwe Klotz
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Triaged
Medium
Unassigned

Bug Description

Shuffling of large playlists is slow as reported here:

http://www.mixxx.org/forums/viewtopic.php?f=3&t=8921

The poor performance is caused by repeatedly swapping the playlist's track positions directly in the database.

Proposal for an improved algorithm:
1) Read the ordered list of track positions from the database
2) Calculate a random permutation of these track positions in memory
3) Update the track positions in the database within a single pass

The proposed algorithm works even if the current positions are not numbered consecutively, which has been an issue in the past and should be taken into account.

Tags: easy library
Changed in mixxx:
status: New → Confirmed
importance: Undecided → Medium
tags: added: library
Revision history for this message
Nimit Bhardwaj (nimitbhardwaj) wrote :

I take this bug, this bug seems to be an easy for me, I feel it interesting, i will try to solve it.

Changed in mixxx:
assignee: nobody → Nimit Bhardwaj (nimitbhardwaj)
Revision history for this message
Nimit Bhardwaj (nimitbhardwaj) wrote :
Changed in mixxx:
status: Confirmed → In Progress
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Due to lack of progress, marking Triaged and clearing assignee. Feel
free to revert if it is in fact still in progress :).

Changed in mixxx:
assignee: Nimit Bhardwaj (nimitbhardwaj) → nobody
status: In Progress → Triaged
tags: added: easy
Revision history for this message
Gabriel Downs (gndowns) wrote :

Is this still open? I'm new to mixxx, but it seems like the old PR could be fixed up to work.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

It is currently closed, mainly because it has stalled.
If you like to continue the work I think it is a good idea to open a new one from the scratch and use the old one and the comments for inspiration.
Thank you in advance.

Did you now this page, by the way? https://www.mixxx.org/wiki/doku.php/bugfix_workflow

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

The old PR didn't meet our quality requirements and was unfinished. I recommend starting a new approach at the current version.

Revision history for this message
Gabriel Downs (gndowns) wrote :

Ah I hadn't seen that page before, thank you! I'll check it all out

Revision history for this message
Vladimír Dudr (vlada-dudr) wrote :

I was working on this a little bit. It looks like it is shuffling only certain tracks in the playlist - why it is necessary to skip certain ones?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

The shuffling is started here:
https://github.com/mixxxdj/mixxx/blob/9ea985dd613b4b34679888820f7367dd258f5447/src/library/autodj/autodjprocessor.cpp#L213

Only selected Tracks are shuffled. Is That the issue you experience?

Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8809

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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