Skip to content
Snippets Groups Projects
Commit 00ea1116 authored by Matěj Laitl's avatar Matěj Laitl
Browse files

Optimize and simplify Playlist::Model::removeTracksCommand()

We don't need to keep track of multiple command lists when removing,
just sort rows to remove first and then keep track of how many rows
have been already removed and subtract it at appropriate places.

The optimization is finding consecutive runs of rows to remove and then
grouping begin/endRemoveRows() for them, which was the main CPU hog as
it updates above models and view.

Removing 24.658 tracks from 24.660-track-long playlist now takes about
half a second, which is hopefully acceptable.

Also note that even greater optimization was done by Ralf Engels
earlier after 2.7, commit 861143c0, where he cleverly used
references where appropriate, and much more.

@Patrick, please retest with Amarok git master, it should be much
better.

BUG: 316242
FIXED-IN: 2.8
CCMAIL: Ralf Engels <ralf-engels@gmx.de>
DIGEST: Optimization: removing tens of thousands of tracks from Amarok
playlist is now much faster.
parent 2841fa9a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment