Review Request: Dolphin - optimize use of PlacesItemModel

Dan Vrátil dvratil at redhat.com
Thu Nov 1 13:13:13 GMT 2012


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

Review request for Dolphin.


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/CMakeLists.txt 8f7f4db 
  dolphin/src/dolphincontextmenu.cpp bb26c7a 
  dolphin/src/dolphinmainwindow.h ab79fb0 
  dolphin/src/dolphinmainwindow.cpp babaf14 
  dolphin/src/panels/places/placescache.h PRE-CREATION 
  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/20121101/59675d86/attachment.htm>


More information about the kfm-devel mailing list