Review Request: Load Solid devices in KFilePlacesModel asynchronously

Dan Vrátil dvratil at redhat.com
Thu Nov 29 14:53:36 GMT 2012


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

Review request for kdelibs and David Faure.


Description
-------

With KDE 4.10 Solid will provide udisks2 backend. Unfortunately udisks2 is somewhat slower then udisks1 and listing all the devices when starting Gwenview or file dialog takes more time then is acceptable for users. I only have a single optical drive and one HDD with 4 partitions and it takes ~2 seconds for the file dialog to appear and udisks2d causes high CPU spikes during that. And it gets much worse with slow, cheap USB sticks etc.

This patch adds an asynchronous cache, which will call Solid::Devices::listFromQuery() in a thread and then notify listeners through deviceAdded() signal about all the devices received. The cache keeps itself up-to-date (via Solid::DeviceNotifier) and notifies listeners about these changes via deviceAdded() and deviceRemoved() signals. This patch also ports the KFilePlacesModel to use the cache which results in KFileDialog appearing immediately. Gwenview also starts faster.

The KFilePlacesDeviceCache class is exported as public because of Dolphin, which has it's own implementation of places model similar to KFilePlacesModel and which suffers from the same problems (and possibly there are other apps). We have already verified that porting Dolphin's model to this cache resolves the issue. Better solution would be for libsolid to have asynchronous API, however that's not possible now with kdelibs being feature-frozen. With libsolid2, this class can go away. Meanwhile however it's the only way to fix this performance regression that will hit every distro that will decide to ditch udisks1 with KDE 4.10 and switch to udisks2.


Diffs
-----

  kfile/CMakeLists.txt ceae140 
  kfile/kfileplacesdevicecache.h PRE-CREATION 
  kfile/kfileplacesdevicecache.cpp PRE-CREATION 
  kfile/kfileplacesmodel.cpp 0192926 

Diff: http://git.reviewboard.kde.org/r/107513/diff/


Testing
-------


Thanks,

Dan Vrátil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20121129/83c39549/attachment.htm>


More information about the kde-core-devel mailing list