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

[clang-format] high cpu with master

    XMLWordPrintable

Details

    Description

      it seems to me that the cpu load of qtcreator increased from 8.0 to master when using the clang-format plugin.

      looking at the instruments profiles, it seems that drawing widgets causes clang-format to reformat the sources (note that i have "format while typing" disabled in my configuration):

      0   3.44 s    3.5%  0 s                                            QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*)
      0   3.42 s    3.5%  0 s                                             QCoreApplication::notifyInternal2(QObject*, QEvent*)
      0   3.42 s    3.5%  0 s                                              QApplication::notify(QObject*, QEvent*)
      0   3.42 s    3.5%  0 s                                               QApplicationPrivate::notify_helper(QObject*, QEvent*)
      0   3.42 s    3.5%  0 s                                                QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*)
      0   3.42 s    3.5%  0 s                                                 TextEditor::TextEditorWidget::viewportEvent(QEvent*)
      0   3.42 s    3.5%  0 s                                                  QAbstractScrollArea::viewportEvent(QEvent*)
      0   3.42 s    3.5%  0 s                                                   QWidget::event(QEvent*)
      6   3.42 s    3.5%  6.00 ms                                                    TextEditor::TextEditorWidget::paintEvent(QPaintEvent*)
      0   2.03 s    2.1%  0 s                                                     ClangFormat::ClangFormatBaseIndenter::indentFor(QTextBlock const&, TextEditor::TabSettings const&, int)
      1   2.02 s    2.1%  1.00 ms                                                      ClangFormat::ClangFormatBaseIndenter::indentsFor(QTextBlock, QTextBlock const&, QChar const&, int, bool)
      3   8.00 ms    0.0% 3.00 ms                                                      QTextDocument::toPlainText() const
      2   987.00 ms    1.0%   2.00 ms                                                     CppEditor::Internal::CppEditorDocument::tabSettings() const
      0   984.00 ms    1.0%   0 s                                                      ClangFormat::ClangFormatIndenter::tabSettings() const
      2   984.00 ms    1.0%   2.00 ms                                                       ClangFormat::ClangFormatBaseIndenter::styleForFile() const
      8   934.00 ms    0.9%   8.00 ms                                                        clang::format::getStyle(llvm::StringRef, llvm::StringRef, llvm::StringRef, llvm::StringRef, llvm::vfs::FileSystem*, bool)
      1   28.00 ms    0.0%    1.00 ms                                                        ProjectExplorer::SessionManager::projectForFile(Utils::FilePath const&)
      2   4.00 ms    0.0% 2.00 ms                                                        clang::format::getLLVMStyle(clang::format::FormatStyle::LanguageKind)
      2   4.00 ms    0.0% 2.00 ms                                                        ProjectExplorer::Project::namedSettings(QString const&) const
      2   3.00 ms    0.0% 2.00 ms                                                        clang::format::FormatStyle::~FormatStyle()
      0   2.00 ms    0.0% 0 s                                                        clang::format::FormatStyle::FormatStyle(clang::format::FormatStyle const&)
      0   2.00 ms    0.0% 0 s                                                        Utils::Id::Id(char const*)
      1   1.00 ms    0.0% 1.00 ms                                                        clang::format::FormatStyle::operator==(clang::format::FormatStyle const&) const
      0   1.00 ms    0.0% 0 s                                                        QString::fromUtf8(QByteArrayView)
      1   1.00 ms    0.0% 1.00 ms                                                        QArrayData::deallocate(QArrayData*, long long, long long)
      1   1.00 ms    0.0% 1.00 ms                                                        QString::toStdString() const
      1   1.00 ms    0.0% 1.00 ms                                                        ProjectExplorer::EditorConfiguration::codeStyle(Utils::Id) const
      1   1.00 ms    0.0% 1.00 ms                                                      TextEditor::TextDocument::tabSettings() const
      1   164.00 ms    0.1%   1.00 ms                                                     TextEditor::TextEditorWidget::paintBlock(QPainter*, QTextBlock const&, QPointF const&, QList<QTextLayout::FormatRange> const&, QRect const&) const
      

       

       

      Attachments

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

        Activity

          People

            artem.sokolovskii Artem Sokolovskii
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes