Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 4.15.0
-
None
Description
Editing C++ code makes QtCreator's main UI thread freeze for 1/2s.
Steps to reproduce:
- Open a moderate/large project, so that QtCreator use ~20GiB of RAM (I opened Chromium project, and QtCreator was using 18GiB). The effect can also be observed with a smaller RAM usage, but it is proportionally less pronounced.
- Open a file from the project and start editing any text.
What happens:
- Entire UI hangs for up to 1/2s.
As far as I understand, it happens because ClangToolRunner::run uses QProcess::start, which uses fork and it all happens in the main thread. And apparently, fork() is not as quick as it was expected. To double-check this I removed clang-tidy and clazy-standalone, and it fixed the issue.
In qtcreator-clangtools-timings.png you can see that the maximum freeze time of the main thread caused by ClangToolRunner::run is 507ms, while the average is 456ms.
In qtcreator-clangtools.png you can see that QtCreator is not doing anything else, and yet ClangToolRunner::run is at the top.
Finally, if you want to investigate the raw data yourself I attached qtcreator_2021_05_22_17_34_03.orbit
What do you think about starting the process from another thread? I think it should fix the issue...
Attachments
Issue Links
- mentioned in
-
Page Loading...
For Gerrit Dashboard: QTCREATORBUG-25774 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
358256,1 | WIP: Run clangtools processes from another thread | 5.0 | qt-creator/qt-creator | Status: ABANDONED | -2 | 0 |
359141,7 | Use process launcher for starting process in ClangToolRunner | master | qt-creator/qt-creator | Status: ABANDONED | 0 | 0 |