Bug 126454 - Selecting many tracks in collectionbrowser and opening context menu hangs amaroK
Summary: Selecting many tracks in collectionbrowser and opening context menu hangs amaroK
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collection Browser (show other bugs)
Version: 1.4-SVN
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-29 10:58 UTC by Sven Krohlas
Modified: 2008-06-15 09:09 UTC (History)
0 users

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 Sven Krohlas 2006-04-29 10:58:21 UTC
Version:           1.4-SVN (using KDE KDE 3.5.2)
Installed from:    SuSE RPMs

Ok, here are the steps to reproduce:

0. you need a _large_ collection
1. open collectionbrowser, select all tracks
2. right-click to open the context menu of the selected tracks

result:
amaroK hangs for about 20 minutes for me (takes 100% cpu), memory usage goes up. After that time it continues as normal (shows context menu)

expected result:
show context menu after... well, a few seconds?

The usual stuff: xine-engine, sqlite (I know sqlite with large collections... but this way you find bugs ;-)

The hang with large CPU usage:
Dangle things this is due to the context menu entry "Edit metainformation of N tracks", where N is the number of selected tracks. counting them takes some time.

If this is correct I suggest the following solution:
Limit N.
if (N > 500) (or whatever numer) then only display "edit metadata of selected tracks", else display "Edit metainformation of N tracks".

Growing memory:
According to pmap memory usage goes up from 117792K to 140396K, so amarok seems to lose 22604K. The collection has a size of 52607 tracks, so that is nearly 0.5K per track. I can attach the pmap and if needed try to create a valgrind-log for this issue.
Comment 1 Martin Aumueller 2006-10-22 18:52:37 UTC
Now, the slowness is due to enumerating the urls of all selected items, which involves many sql queries.
Comment 2 Matt Howe 2008-06-15 09:03:59 UTC
This bug is still present in 1.4.9.1 although it is not present in 2.x and the context menu appears instantly for a selection of ~7000 tracks.
Comment 3 Mark Kretschmann 2008-06-15 09:09:31 UTC
Thanks Matt. Let's consider it fixed then.