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

Code completion performance degradation with Qt Creator 6.0.0

    XMLWordPrintable

Details

    • macOS, Windows
    • d65e47b5c6 (qt-creator/qt-creator/6.0) d65e47b5c6 (qt-creator/qt-creator/master) d65e47b5c6 (qt-creator/qt-creator/qmlprojectstorage) d65e47b5c6 (qt-creator/qt-creator/qds-3.0)

    Description

      In this bug report I am going to test the parsing and code completion speed between Qt Creator 5.0.2 and Qt Creator 6.0.0.

      Qt Creator 5.0.2 was built with Qt 5.15.2 and using Clang 12.0.0.
      Qt Creator 6.0.0 was build with Qt 6.2.1 and using Clang 13.0.0.

      This was done on a Lenovo A485 laptop with AMD Ryzen 7 PRO 2700U from 2019 with Windows 10 x64.

      I did copy the clang and libclang.dll from one version to another to see if the performance degradation was due to the Clang version or to the Qt version.

      I used DebugView to get the logging and before starting qtcreator.exe from a cmd window I enabled some logging like this:

      set QT_LOGGING_RULES=qtc.clang*=true
      

      Then I opened Qt Creator 6.0 source code, waited for the project to load completely and then hit Ctrl+K, then opened up texteditor.cpp, went to the end of the file, waited for syntax highlighting to change colors, and then issued a code completion like:

      IEditor *BaseTextEditor::duplicate()
      {
      
          ...
          
          QTC_CHECK(false);  
          return nullptr;  ^ Ctrl + Space
      }
      

      Then closed texteditor.cpp and did the same operation in total of three times.

      Qt Creator 5.0.2 with Clang 12.0.0

      00000586	73.45362854	[12812] UpdateAnnotationsJobRunner needed 7145 ms
      00000599	76.26050568	[12812] CompleteCodeJobRunner needed 634 ms
      00000630	87.76027679	[12812] UpdateAnnotationsJobRunner needed 6397 ms
      00000643	90.27484131	[12812] CompleteCodeJobRunner needed 677 ms
      00000677	100.90406036	[12812] UpdateAnnotationsJobRunner needed 6434 ms
      00000690	103.72553253	[12812] CompleteCodeJobRunner needed 653 ms
      

      Qt Creator 5.0.2 with Clang 13.0.0 from Qt Creator 6.0.0

      00000598	81.80663300	[11588] UpdateAnnotationsJobRunner needed 7504 ms
      00000611	85.54234314	[11588] CompleteCodeJobRunner needed 672 ms
      00000642	96.97460938	[11588] UpdateAnnotationsJobRunner needed 6484 ms
      00000655	100.26199341	[11588] CompleteCodeJobRunner needed 780 ms
      00000692	112.19184875	[11588] UpdateAnnotationsJobRunner needed 6688 ms
      00000712	115.22787476	[11588] CompleteCodeJobRunner needed 746 ms
      

      As you can see there is some slowdown, but it's not that significant.

      Qt Creator 6.0.0 with Clang 13.0.0

      00000586	93.61444855	[8172] UpdateAnnotationsJobRunner needed 11569 ms
      00000599	99.96090698	[8172] CompleteCodeJobRunner needed 2584 ms
      00000631	117.61567688	[8172] UpdateAnnotationsJobRunner needed 11374 ms
      00000644	124.08489227	[8172] CompleteCodeJobRunner needed 2647 ms
      00000679	138.95407104	[8172] UpdateAnnotationsJobRunner needed 11348 ms
      00000692	144.91577148	[8172] CompleteCodeJobRunner needed 2291 ms
      

      Qt Creator 6.0.0 with Clang 12.0.0 from Qt Creator 5.0.2

      00000586	90.89379883	[12876] UpdateAnnotationsJobRunner needed 11360 ms
      00000599	97.30936432	[12876] CompleteCodeJobRunner needed 2611 ms
      00000631	114.96936035	[12876] UpdateAnnotationsJobRunner needed 11809 ms
      00000644	127.81418610	[12876] CompleteCodeJobRunner needed 2703 ms
      00000676	143.90559387	[12876] UpdateAnnotationsJobRunner needed 11716 ms
      00000689	150.98699951	[12876] CompleteCodeJobRunner needed 3339 ms
      

      The performance with Qt Creator 6.0.0 has taken a serious hit. At least 3x for code completion.

      Attachments

        1. macos-qtcreator5-clang12.log
          220 kB
        2. macos-qtcreator6-clang13.log
          282 kB
        3. macos-qtcreator6-revert-clang13.log
          221 kB
        4. qtc5.0.2-clang12.log
          148 kB
        5. qtc5.0.2-clang13.log
          151 kB
        6. qtc-5.0.3-linux-clang12.log
          139 kB
        7. qtc6.0.0-clang12.log
          150 kB
        8. qtc6.0.0-clang13.log
          150 kB
        9. qtc-6.0.1-linux-clang13.log
          143 kB
        10. qtc-6.0.1-linux-clang13-revert.log
          139 kB
        11. qtcreator6-qt5-clang12.log
          150 kB
        12. qtcreator6-use_qtc_qprocess.log
          229 kB
        13. qtcreator6-with-bad-commit-reverted.log
          149 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kandeler Christian Kandeler
              cadam Cristian Adam
              Votes:
              16 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes