Review Request: Dolphin - optimize use of PlacesItemModel

Lukáš Tinkl lukas at kde.org
Fri Nov 9 16:06:27 GMT 2012



> On Nov. 8, 2012, 4:34 p.m., Frank Reininghaus wrote:
> > @Alex: could you point me to the discussion where the permission to violate the feature freeze for the udisks2 backend was granted? I could not find anything on kde-core-devel, but maybe I've missed it.
> > 
> > If there is really nothing that we can do to either stop the udisks2 backend from being shipped in KDE 4.10 or to add asynchronous API to Solid, I see that something has to be done. However, I don't see at all how https://git.reviewboard.kde.org/r/107030/ fixes this in KFilePlaces*. It was my understanding that the slow part is the call to Solid::Device::listFromQuery(), which still seems to be in KFilePlacesModel. Could you elaborate on that?
> > 
> > Thanks for the new version of the patch - I've added a few comments on the code below.
> > 
> > One more thing: would you mind to change the license of the new files to LGPL? I'm planning to change the license of the kitemviews/ and panels/places/ directories of Dolphin's source to LGPL (Peter already agreed, I'll contact all others who contributed something to those files) in the hope that the 'File' dialogs and Dolphin can share some code again in the bright frameworks future :-)

I got a direct permission from dfaure to import the udisks2 backend (or rather move from kdelibs/frameworks); as already mentioned, the backend is used already at least by Fedora and SUSE and other distros will likely follow suite. 

See commit f2d6c191514ebb64dfa43d2a61995587e02bf1ca


- Lukáš


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107168/#review21631
-----------------------------------------------------------


On Nov. 9, 2012, 3:08 p.m., Dan Vrátil wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107168/
> -----------------------------------------------------------
> 
> (Updated Nov. 9, 2012, 3:08 p.m.)
> 
> 
> Review request for Dolphin and Frank Reininghaus.
> 
> 
> Description
> -------
> 
> This patch optimizes PlacesItemModel in two places. The optimizations are needed when using udisks2 Solid backend (which will be shipped in KDE 4.10, but it's already used in KDE 4.9 at least in Fedora). udisks2 is a bit slower because it only can enumerate all devices (unlike udisks where you can ask for specific device) - and that takes time, especially when there are slow devices (cheap USB sticks, slow optical drive).
> 
> 1) Solid devices are stored in a static cache, which takes care that on startup Solid is only queried once (this eliminates CPU spikes by udisks2d daemon and limits DBus traffic). The Solid query is run asynchronously, which has a positive impact on Dolphin startup time.
> 
> 2) Don't create new PlacesItemModel on every context menu popup. This effectively eliminates ~4 seconds delay between right click and the context menu appearing on screen. The persistent model is owned by DolphinMainView.
> 
> 
> Diffs
> -----
> 
>   dolphin/src/panels/places/placescache.h PRE-CREATION 
>   dolphin/src/CMakeLists.txt 8f7f4db 
>   dolphin/src/dolphincontextmenu.cpp bb26c7a 
>   dolphin/src/panels/places/placescache.cpp PRE-CREATION 
>   dolphin/src/panels/places/placesitemmodel.h 463e564 
>   dolphin/src/panels/places/placesitemmodel.cpp 1789f18 
> 
> Diff: http://git.reviewboard.kde.org/r/107168/diff/
> 
> 
> Testing
> -------
> 
> Start up time and opening context menu is faster, no CPU spikes from udisks2d deamon
> 
> 
> Thanks,
> 
> Dan Vrátil
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20121109/ec0cd888/attachment.htm>


More information about the kfm-devel mailing list