Skip to content
  • Matěj Laitl's avatar
    Optimize and simplify Playlist::Model::removeTracksCommand() · 00ea1116
    Matěj Laitl authored
    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.
    00ea1116
To find the state of this project's repository at the time of any of these versions, check out the tags.