https://bugs.kde.org/show_bug.cgi?id=386720

Milian Wolff <m...@milianw.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
      Latest Commit|                            |https://commits.kde.org/kde
                   |                            |velop/f2a6941e086cdf506c8fb
                   |                            |1798c52982bff43792d
             Status|CONFIRMED                   |RESOLVED

--- Comment #11 from Milian Wolff <m...@milianw.de> ---
Git commit f2a6941e086cdf506c8fb1798c52982bff43792d by Milian Wolff.
Committed on 10/01/2018 at 10:37.
Pushed by mwolff into branch '5.2'.

Cache ProblemPointers per translation unit

Summary:
For visibility purposes, all 'inclue file not found' errors are
associated with all files in a TU, since these usually completely
break the interpretation of a file. But in some situations, this
triggers a severe performance degradation:

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

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

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

Reviewers: #kdevelop

Subscribers: kdevelop-devel

Differential Revision: https://phabricator.kde.org/D9772

M  +8    -1    plugins/clang/duchain/parsesession.cpp
M  +2    -0    plugins/clang/duchain/parsesession.h

https://commits.kde.org/kdevelop/f2a6941e086cdf506c8fb1798c52982bff43792d

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to