<table><tr><td style="">rjvbb added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D7742" rel="noreferrer">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">Doesn't mac have directory watches which watch the whole subtree?</pre></div></blockquote>

<p>My plan had been to have a look at KDirWatch after getting this into a more or less acceptable form (and upgrading a bunch of other packages including the frameworks).</p>

<p>Mac has FSEvents, I have no experience with the API. I see Qt's QFileSystemWatcher uses it, but that doesn't mean KDirWatch does (by default) nor that it's an efficient API or implementation.</p>

<p>For comparison, on Mac (2.7 Ghz i7, fs=HFS+):</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">> time kf5-kcoreaddons/work/build/autotests/kdirwatch_qfswatch_unittest.app/Contents/MacOS/kdirwatch_qfswatch_unittest
********* Start testing of KDirWatch_UnitTest *********
Config: Using QtTest library 5.8.0, Qt 5.8.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by Clang 6.0 (clang-600.0.57) (Apple))
PASS   : KDirWatch_UnitTest::initTestCase()
PASS   : KDirWatch_UnitTest::touchOneFile()
QWARN  : KDirWatch_UnitTest::touch1000Files() Timeout waiting for KDirWatch. Got 1 dirty() signals, expected 100
PASS   : KDirWatch_UnitTest::touch1000Files()
PASS   : KDirWatch_UnitTest::watchAndModifyOneFile()
PASS   : KDirWatch_UnitTest::removeAndReAdd()
PASS   : KDirWatch_UnitTest::watchNonExistent()
PASS   : KDirWatch_UnitTest::watchNonExistentWithSingleton()
PASS   : KDirWatch_UnitTest::testDelete()
QWARN  : KDirWatch_UnitTest::testDeleteAndRecreateFile() Timeout waiting for KDirWatch signal deleted(QString) ( "/var/folders/j1/1439ppj08xj8h6006s6drbq00000gs/T/kdirwatch_qfswatch_unittest-seruXE/subdir/1" )
FAIL!  : KDirWatch_UnitTest::testDeleteAndRecreateFile() Failed to detect file deletion and recreation through either a deleted/created signal pair or through a dirty signal!
   Loc: [//path/to/kf5-kcoreaddons/work/kcoreaddons-5.35.0/autotests/kdirwatch_unittest.cpp(532)]
QWARN  : KDirWatch_UnitTest::testDeleteAndRecreateDir() Timeout waiting for KDirWatch signal "deleted(QString)" ( "/var/folders/j1/1439ppj08xj8h6006s6drbq00000gs/T/olddir-B65x4e/" )
FAIL!  : KDirWatch_UnitTest::testDeleteAndRecreateDir() 'waitForOneSignal(watch, SIGNAL(deleted(QString)), path1)' returned FALSE. ()
   Loc: [//path/to/kf5-kcoreaddons/work/kcoreaddons-5.35.0/autotests/kdirwatch_unittest.cpp(558)]
PASS   : KDirWatch_UnitTest::testMoveTo()
PASS   : KDirWatch_UnitTest::nestedEventLoop()
PASS   : KDirWatch_UnitTest::testHardlinkChange()
PASS   : KDirWatch_UnitTest::stopAndRestart()
PASS   : KDirWatch_UnitTest::shouldIgnoreQrcPaths()
PASS   : KDirWatch_UnitTest::cleanupTestCase()
Totals: 14 passed, 2 failed, 0 skipped, 0 blacklisted, 21509ms
********* Finished testing of KDirWatch_UnitTest *********
0.053 user_cpu 0.114 kernel_cpu 0:21.53 total_time 0.7%CPU {7843840M 0F 2340R 0I 13O 0k 0w 2086c}</pre></div>

<p>On my Linux rig (1.6Ghz N3150, fs=ZFS):</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">> time kf5-kcoreaddons/work/build/autotests/kdirwatch_qfswatch_unittest
********* Start testing of KDirWatch_UnitTest *********
Config: Using QtTest library 5.8.0, Qt 5.8.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 6.2.0 20160901)
PASS   : KDirWatch_UnitTest::initTestCase()
PASS   : KDirWatch_UnitTest::touchOneFile()
PASS   : KDirWatch_UnitTest::touch1000Files()
PASS   : KDirWatch_UnitTest::watchAndModifyOneFile()
PASS   : KDirWatch_UnitTest::removeAndReAdd()
PASS   : KDirWatch_UnitTest::watchNonExistent()
PASS   : KDirWatch_UnitTest::watchNonExistentWithSingleton()
PASS   : KDirWatch_UnitTest::testDelete()
PASS   : KDirWatch_UnitTest::testDeleteAndRecreateFile()
PASS   : KDirWatch_UnitTest::testDeleteAndRecreateDir()
PASS   : KDirWatch_UnitTest::testMoveTo()
PASS   : KDirWatch_UnitTest::nestedEventLoop()
PASS   : KDirWatch_UnitTest::testHardlinkChange()
PASS   : KDirWatch_UnitTest::stopAndRestart()
PASS   : KDirWatch_UnitTest::shouldIgnoreQrcPaths()
PASS   : KDirWatch_UnitTest::cleanupTestCase()
Totals: 16 passed, 0 failed, 0 skipped, 0 blacklisted, 14903ms
********* Finished testing of KDirWatch_UnitTest *********
0.257 user_cpu 0.212 kernel_cpu 0:14.92 total_time 3.0%CPU {7752M 0F 565R 61I 0O 1103w 275c}</pre></div>

<p>R.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D7742" rel="noreferrer">https://phabricator.kde.org/D7742</a></div></div><br /><div><strong>To: </strong>rjvbb, KDevelop, mwolff, brauch<br /><strong>Cc: </strong>mwolff, kossebau, arrowdodger, brauch, zhigalin, kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight<br /></div>