<table><tr><td style="">rjvbb created this revision.<br />rjvbb added a project: KDevelop.<br />Restricted Application added a subscriber: kdevelop-devel.
</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><strong>REVISION SUMMARY</strong><div><p>As described on the ML: importing really big projects into a KDevelop session (as well as closing them) can take a really long time during which the main thread runs at full throttle making the UI unresponsive. This is not related to background parsing but to installing watchers on countless directories and/or files.</p>

<p>This was observed on Mac while reopening an session that contained projects for the gcc 6.3.0 and 7.1.0 source trees. Monitoring on-disk changes is unreliable on that platform (= never worked for me) so the workaround is trivial for this kind of projects: don't create KDirWatcher instances for "huge" projects. With that workaround even the gcc projects load in what seems to be a reasonable time; exitting KDevelop becomes a lot faster too.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Developed in the 5.1 branch on OS X 10.9 with Qt 5.8 and KF5 5.35.0; tested on Linux with the same versions. I'm not certain to what extent the underlying issue exists on Linux; my Linux system is simply not powerful enough to expect reasonable snappiness working with projects this big.</p>

<p>I've decided to make <tt style="background: #ebebeb; font-size: 13px;">IProjectController::watchAllProjectDirectories()</tt> a regular, virtual method instead of a static like <tt style="background: #ebebeb; font-size: 13px;">parseAllProjectSources()</tt> ; the idea is that this would allow to make this new option apply on a per-project base with the session-level setting a default/fallback.</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>AFFECTED FILES</strong><div><div>kdevplatform/interfaces/iprojectcontroller.cpp<br />
kdevplatform/interfaces/iprojectcontroller.h<br />
kdevplatform/project/abstractfilemanagerplugin.cpp<br />
kdevplatform/shell/settings/projectconfig.kcfg<br />
kdevplatform/shell/settings/projectpreferences.ui</div></div></div><br /><div><strong>To: </strong>rjvbb, KDevelop<br /><strong>Cc: </strong>kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger<br /></div>