Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25774

QtCreator hangs for 0.5s while typing

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/X11

      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

          For Gerrit Dashboard: QTCREATORBUG-25774
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              jkobus Jarek Kobus
              Reporter:
              dimanne DimanNe
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes