D7995: KDevelop: address dirwatching inefficiency (WIP/PoC)

René J.V. Bertin noreply at phabricator.kde.org
Wed Nov 15 19:31:32 UTC 2017


rjvbb updated this revision to Diff 22412.
rjvbb added a comment.


  This is the updated version of my proposal, rebased on the master branch.
  
  To summarise:
  
  - the KDirWatch instance is wrapped in an instance of a new ProjectWatcher class, ignoring duplicate watching requests and keeping track of the number of watched directories
  - the FileManagerListJob emits a watchDir signal when it visits a directory (which only happens when it's not rejected by the project filter.
  - the AbstractFileManagerPlugin receives this signal, adding individual directories of interest to the dirwatcher.
  
  This construction prevents race conditions that would otherwise require a global mutex, More importantly, it also "inlines" the dirwatcher population, removing the need for an atomic, uninterruptable and potentially (very) long action on the main thread, blocking the GUI (the original issue this patch is meant to address).
  
  The resulting project no longer watches all items (dirs AND files) under the project directory, but only the directories that are not filtered out. I think it is thus relevant to output the number of watched directories in the benchmark I'd add something like "of N directories total" but haven't been able to figure out if that information is even available from the project or project controller.

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D7995?vs=20192&id=22412

REVISION DETAIL
  https://phabricator.kde.org/D7995

AFFECTED FILES
  kdevplatform/project/CMakeLists.txt
  kdevplatform/project/abstractfilemanagerplugin.cpp
  kdevplatform/project/filemanagerlistjob.cpp
  kdevplatform/project/filemanagerlistjob.h
  kdevplatform/project/projectwatcher.cpp
  kdevplatform/project/projectwatcher.h
  kdevplatform/project/tests/abstractfilemanagerpluginimportbenchmark.cpp

To: rjvbb, #kdevelop, mwolff
Cc: aaronpuchert, arrowdodger, kfunk, dfaure, mwolff, brauch, kdevelop-devel, njensen, geetamc, Pilzschaf, akshaydeo, surgenight
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20171115/bafbe498/attachment.html>


More information about the KDevelop-devel mailing list