Review Request: Dolphin - optimize use of PlacesItemModel

Dan Vrátil dvratil at redhat.com
Sat Nov 10 09:48:43 GMT 2012



> On Nov. 9, 2012, 10:20 p.m., Frank Reininghaus wrote:
> > @Lukáš: Thanks for the information!
> > 
> > @Dan: Thanks for the new patch, but you still did not answer my question. In case I wasn't clear enough:
> > 
> > 1. Which call to Solid is the slow one?
> > 2. If I am assuming correctly that it's Solid::Device::listFromQuery(), how can it be that udisks2 can block Dolphin on startup, but not the file dialog when it's opened? I really do not understand that.
> > 
> > It looks to me like one would need to do the very same thing in KFilePlaces*, which makes me wonder if your PlacesCache wouldn't be better moved to some location like kdelibs/kfile. I'm sure that David would allow that as well if my assumption that Dolphin, the file dialog and maybe other apps will suffer from the same problem and need the same solution.

Sorry, didn't read last comment properly :)

ad 1) It's Solid::Device::listFromQuery() - it boils down to a synchronous DBus call to udisks2 which blocks
ad 2) we didn't try to fix start up time of the dialog, rather improve performance by preventing the dialog polling udisks2 for information that can be easily cached

I will try to talk about this to David on Monday.


- Dan


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


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/20121110/f68d6971/attachment.htm>


More information about the kfm-devel mailing list