<table><tr><td style="">mwolff created this revision.<br />Restricted Application added a subscriber: kdevelop-devel.<br />mwolff requested review of this revision.
</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/D9772" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>For visibility purposes, all 'inclue file not found' errors are<br />
associated with all files in a TU, since these usually completely<br />
break the interpretation of a file. But in some situations, this<br />
triggers a severe performance degradation:</p>

<p>When the TU has a deep include stack depth and a file is not found<br />
somewhere at the bottom of the stack, then it will have one child<br />
diagnostic for every "included from ..." file higher up in the stack.<br />
Now if we would repeatedly build and intern the KDevelop::Problem<br />
representation for these diagnostics, for every file in the TU, we<br />
sometimes ended up spending *minutes* to create all the problems<br />
in ParseSession::problemsForFile!</p>

<p>To workaround this situation, cache the ProblemPointer in the<br />
ParseSessionData for a given translation unit. This way, we will<br />
only convert a given diagnostic and its child diagnostics once per TU<br />
instead of once per file contained in a TU.</p>

<p>In my case this brings down the time spent in problemsForFile for a<br />
single TU from ~7min (sic!) down to ~12s. While the latter is still<br />
a lot, this is already much more bearable.</p>

<p>BUG: 386720</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9772" rel="noreferrer">https://phabricator.kde.org/D9772</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>plugins/clang/duchain/parsesession.cpp<br />
plugins/clang/duchain/parsesession.h</div></div></div><br /><div><strong>To: </strong>mwolff<br /><strong>Cc: </strong>kdevelop-devel<br /></div>