Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 3.5.0-beta1
-
None
-
Kubuntu 15.04, x86_64, XFCE 4.12. Not using clang C++ parser backend.
Description
Sometimes when editing or simply navigating C++ code QtCreator starts to consume 100% of one or several CPU cores. In some cases this results in UI being blocked for considerable time (I had cases of several seconds, but more often the UI is not blocked or responsiveness is slightly reduced). I dumped a few backtraces of QtCreator while CPU load is high and it looks like only threads involving C++ parser are active at that time (one or multiple threads). See these backtraces attached.
I've started noticing this behavior in QtCreator 3.4.2 and didn't notice it in 3.4.1. The problem is also present in 3.5.0 beta1.
It doesn't seem like the behavior is triggered by a particular code, although it is possible that it depends on the size and complexity of the function being edited and the surrounding code. We're using C++11 with Boost 1.58. You can try typing the following code piece in a CMake C++ project with Boost headers in your include path:
#include <cstdint> #include <cmath> #include <limits> #include <boost/assert.hpp> #include <boost/mpl/assert.hpp> #include <boost/fusion/include/at.hpp> #include <boost/fusion/include/vector.hpp> #include <boost/fusion/include/tuple.hpp> #include <boost/fusion/include/zip.hpp> #include <boost/fusion/include/accumulate.hpp> #include <boost/type_traits/is_same.hpp> namespace foo { float bar() { struct local { static void local_foo() { } }; local::local_foo(); return 0.0; } }
As you type, you will notice high CPU load. You can also try to navigate around this code with mouse by clicking on function/class/namespace names (to move the cursor to the clicked point). You will notice the interface becoming sluggish and high CPU load.