Summary: | Cover manager is slow/freezes | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Michael Reiher <redm> |
Component: | general | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | endrebjorsvik, fulmare90, jajaxor |
Priority: | NOR | ||
Version: | 2.3-GIT | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Improve covermanager startup and fix freezes. |
Description
Michael Reiher
2009-10-13 18:18:15 UTC
Probably a duplicate of bug 197242 Michael, I think you would make many people happy, (including me :P) if you could come up with a patch for this bug! As you said, loading the cover manager takes lot of memory: those with large collections like me end up with a trashed system, also because you can't cancel the cover manager loading (that's bug #204882 ). Thanks commit 26c2c503eabc4c098e3ab538753cbf85e91db71b Author: Mark Kretschmann <kretschmann@kde.org> Date: Wed Oct 14 11:46:26 2009 +0200 Remove pointless QPixmap conversion, which slowed down CoverManager. commit 52efeaa7d714994680cd0cb7a4145ab21782d0fd Author: Mark Kretschmann <kretschmann@kde.org> Date: Wed Oct 14 12:44:15 2009 +0200 Remove some unnecessary image scaling when loading CoverManager. CCBUG: 210454 What this class really needs is on-demand loading when you scroll, I think. That's the only way to really solve it. Perhaps I'm completely missing something here, so correct when I'm wrong, but your changes don't make much sense to me... Removing CoverViewItem::m_coverPixmap (holding the full sized image) was surely a good idea, as it wasn't used anyway and was the real cause for the tremendous memory usage. However then you used the full sized image instead of the size 100 one as item icon...? :) Well, in the end it used only a little bit less memory (the size 100 images) and was probably even a bit slower than before (2 times loading the full size image per album). Also it didn't affect my original problem, the 20s freezes, at all. I dug a bit more into the code and made a patch (attached to this report) which uses only a fraction of memory and loading time and also (almost) removes the freezes. Now I load only the size 100 images and removed loading the full size images entirely. The loadCover() in CoverViewItem() is completly redundant with m_coverPixmap removed. To remove the freezes I made a separate implementation for SqlAlbum::hasImage which doesn't load a large image just to check it's existence. IMHO it's better to use SqlAlbum::image() only when we really want an image. One thing left which I found confusing is the 60s timer in SqlRegistry which clears all caches, one of the reasons for the freezes. With the optimization of SqlAlbum::hasImage things are a lot better than before, there is still a little lag ever 60s (the constantly triggered updateStatusBar checks all album covers for existence). If there are questions or suggestions, I'm happy to hear! Created attachment 37602 [details]
Improve covermanager startup and fix freezes.
Patch against current Git.
Many thanks Michael, I've committed your patch: commit 9e36c0320b07a83b5ec796a1b463fca15013ebcc Author: Mark Kretschmann <kretschmann@kde.org> Date: Fri Oct 16 07:44:47 2009 +0200 Huge performance improvements for the Cover Manager. Thanks to Michael Reiher <redm@gmx.de> for the patch! BUG: 210454 PS: About the 60s timer clearing the cache, this sounds very odd to me too. I think we could reduce the frequency a lot. Maybe 10 minutes or so? thanks for the patch. Now my 1600 album covers are loaded almost immediately. But I do notice lots of disk activity shortly after. (In reply to comment #9) > PS: About the 60s timer clearing the cache, this sounds very odd to me too. I > think we could reduce the frequency a lot. Maybe 10 minutes or so? Well, don't ask me, why it's there and why it's 60s. I don't really have a clue here. :) But it seems to be a more general thing with the SQL collections, i.e. not related to the cover manager. Normally apparently not really noticeable. A thought I had was to perhaps suspend it, while the manager is up. (In reply to comment #10) > thanks for the patch. Now my 1600 album covers are loaded almost immediately. > But I do notice lots of disk activity shortly after. This probably has to do with the above mentioned timer. It periodically clears all info about the covers, so they have to be rechecked, which gives a little lag. Not nice, but at least a lot better than before ;) commit 5fdae6069cfb8723169f31f851c4caa3936b172f Author: Mark Kretschmann <kretschmann@kde.org> Date: Fri Oct 16 11:30:19 2009 +0200 Reduce SqlRegistry cache clearing frequency from 60s to 300s. This should improve performance somewhat, especially for cover image handling. CCBUG: 210454 *** Bug 212964 has been marked as a duplicate of this bug. *** Hi (sorry again and again for my bad english...) I never see this bug report sorry but A BIG thanks for your help and works ;) arghhh, I want update to 2.2.1 more now !!!!!!!!! *** Bug 215159 has been marked as a duplicate of this bug. *** |