Review Request: Dolphin - optimize use of PlacesItemModel

Dan Vrátil dvratil at redhat.com
Thu Nov 8 11:33:00 GMT 2012


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

(Updated Nov. 8, 2012, 11:33 a.m.)


Review request for Dolphin and Frank Reininghaus.


Changes
-------

Context menu now loads Places directly from kfileplaces/bookmarks.xml


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 (updated)
-----

  dolphin/src/CMakeLists.txt 8f7f4db 
  dolphin/src/dolphincontextmenu.cpp bb26c7a 
  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/20121108/a54dbe60/attachment.htm>


More information about the kfm-devel mailing list