<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/D7995" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>I misremembered the exact reason I use an explicit queued connection. Some results on Linux, connecting FMLJ::watchDir without explicitly queued connection:</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);">KDirWatch backend: Inotify
Starting import of project kdevelop-git
creating dirwatcher took 0 seconds
Starting import of project /opt/local/site-ports
creating dirwatcher took 0 seconds
Starting import of project /opt/local/linux-ports
creating dirwatcher took 0 seconds
importing 3894 items into project #2 with 617 call(s) to KDirWatch::addDir() took 0.827 seconds
importing 5987 items into project #1 with 1189 call(s) to KDirWatch::addDir() took 1.321 seconds
importing 13361 items into project #0 with 2675 call(s) to KDirWatch::addDir() took 2.258 seconds
kdevplatform.filemanager: Deleting dir watcher took 0.026 seconds for project "Test Project"
kdevplatform.filemanager: Deleting dir watcher took 0.01 seconds for project "Test Project"
kdevplatform.filemanager: Deleting dir watcher took 0.005 seconds for project "Test Project"
Done in 2.259 seconds total
org.kde.kwindowsystem: Loaded plugin "/opt/local/share/qt5/plugins/kf5/org.kde.kwindowsystem.platforms/KF5WindowSystemX11Plugin.so" for platform "xcb"
cannot find .rc file "abstractfilemanagerpluginimportbenchmarkui.rc" for component "abstractfilemanagerpluginimportbenchmark"
KDirWatch backend: Inotify
Starting import of project kdevelop-git
creating dirwatcher took 0 seconds
Starting import of project /opt/local/site-ports
creating dirwatcher took 0 seconds
Starting import of project /opt/local/linux-ports
creating dirwatcher took 0 seconds
importing 3894 items into project #2 with 617 call(s) to KDirWatch::addDir() took 0.972 seconds
importing 5987 items into project #1 with 1189 call(s) to KDirWatch::addDir() took 1.322 seconds
importing 13361 items into project #0 with 2675 call(s) to KDirWatch::addDir() took 2.315 seconds
kdevplatform.filemanager: Deleting dir watcher took 0.026 seconds for project "Test Project"
kdevplatform.filemanager: Deleting dir watcher took 0.009 seconds for project "Test Project"
kdevplatform.filemanager: Deleting dir watcher took 0.005 seconds for project "Test Project"
Done in 2.316 seconds total
org.kde.kwindowsystem: Loaded plugin "/opt/local/share/qt5/plugins/kf5/org.kde.kwindowsystem.platforms/KF5WindowSystemX11Plugin.so" for platform "xcb"
cannot find .rc file "abstractfilemanagerpluginimportbenchmarkui.rc" for component "abstractfilemanagerpluginimportbenchmark"
KDirWatch backend: Inotify
Starting import of project kdevelop-git
creating dirwatcher took 0 seconds
Starting import of project /opt/local/site-ports
creating dirwatcher took 0 seconds
Starting import of project /opt/local/linux-ports
creating dirwatcher took 0 seconds
importing 3894 items into project #2 with 617 call(s) to KDirWatch::addDir() took 0.818 seconds
importing 5987 items into project #1 with 1189 call(s) to KDirWatch::addDir() took 1.341 seconds
importing 13361 items into project #0 with 2675 call(s) to KDirWatch::addDir() took 2.354 seconds
kdevplatform.filemanager: Deleting dir watcher took 0.019 seconds for project "Test Project"
kdevplatform.filemanager: Deleting dir watcher took 0.011 seconds for project "Test Project"
kdevplatform.filemanager: Deleting dir watcher took 0.005 seconds for project "Test Project"
Done in 2.355 seconds total
org.kde.kwindowsystem: Loaded plugin "/opt/local/share/qt5/plugins/kf5/org.kde.kwindowsystem.platforms/KF5WindowSystemX11Plugin.so" for platform "xcb"
cannot find .rc file "abstractfilemanagerpluginimportbenchmarkui.rc" for component "abstractfilemanagerpluginimportbenchmark"
KDirWatch backend: Inotify
Starting import of project kdevelop-git
creating dirwatcher took 0 seconds
Starting import of project /opt/local/site-ports
creating dirwatcher took 0 seconds
Starting import of project /opt/local/linux-ports
creating dirwatcher took 0 seconds
importing 3894 items into project #2 with 617 call(s) to KDirWatch::addDir() took 2.486 seconds
importing 5987 items into project #1 with 1189 call(s) to KDirWatch::addDir() took 6.355 seconds
importing 13361 items into project #0 with 2675 call(s) to KDirWatch::addDir() took 12.064 seconds
kdevplatform.filemanager: Deleting dir watcher took 0.02 seconds for project "Test Project"
kdevplatform.filemanager: Deleting dir watcher took 0.009 seconds for project "Test Project"
kdevplatform.filemanager: Deleting dir watcher took 0.006 seconds for project "Test Project"
Done in 12.065 seconds total
Performance counter stats for 'kdevld-lnx-work/build/kdevplatform/project/tests/abstractfilemanagerpluginimportbenchmark kk-git/ /opt/local/site-ports/ /opt/local/linux-ports/' (5 runs):
5300.862525 task-clock:u (msec) # 0.766 CPUs utilized ( +- 7.38% )
0 context-switches:u # 0.000 K/sec
0 cpu-migrations:u # 0.000 K/sec
17,837 page-faults:u # 0.003 M/sec ( +- 0.04% )
5,006,341,532 cycles:u # 0.944 GHz ( +- 0.86% )
2,406,178,384 instructions:u # 0.48 insn per cycle ( +- 0.11% )
554,704,041 branches:u # 104.644 M/sec ( +- 0.10% )
28,264,799 branch-misses:u # 5.10% of all branches ( +- 1.00% )
6.920373566 seconds time elapsed ( +- 28.17% )</pre></div>
<p>Notice the last run which all of a sudden took much longer. This sort of even happened to me twice in a row, without any apparent reason like another application hogging the CPU or preempting the disk (as far as I can tell). It's not something I can reproduce at will (and it used to be easier to observer in earlier versions of this patch) but I've never seen it when using an explicitly queued connection.</p>
<p>How would Qt detect here that a queued connection is required? How can it know that the FileManagerListJob allocated in the same thread as the call to connect() will send the watchDir signal from another thread?</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/D7995" rel="noreferrer">https://phabricator.kde.org/D7995</a></div></div><br /><div><strong>To: </strong>rjvbb, KDevelop, mwolff<br /><strong>Cc: </strong>aaronpuchert, arrowdodger, kfunk, dfaure, mwolff, brauch, kdevelop-devel, njensen, geetamc, Pilzschaf, akshaydeo, surgenight<br /></div>