Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-29418

Editing large text documents with Qt Quick TextEdit is really slow

    XMLWordPrintable

Details

    Description

      Reproducable with the following qml snippet.

      Paste in a large text file (hundreds of lines). You can now type faster than it the TextEdit updates.

      import QtQuick 2.0
      
      Flickable {
              width:600
              height :500
      
      
          contentHeight: tt.implicitHeight
          contentWidth: tt.implicitWidth
         
         TextEdit {
              id: tt
              width:1000
              height :500
              textFormat: TextEdit.PlainText
          }
      }
      
      

      Instruments trace part 1:

      Running Time	Samples	Self		Symbol Name
      4910.0ms   43.8%	4910   43.8%	4910.0	 	QCoreTextFontEngine::boundingBox(unsigned int)
      4908.0ms   43.8%	4908   43.8%	0.0	 	 QFontEngine::getGlyphBearings(unsigned int, double*, double*)
      4908.0ms   43.8%	4908   43.8%	0.0	 	  QTextLine::layout_helper(int)
      4908.0ms   43.8%	4908   43.8%	0.0	 	   QTextLine::setLineWidth(double)
      4908.0ms   43.8%	4908   43.8%	0.0	 	    QTextDocumentLayoutPrivate::layoutBlock(QTextBlock const&, int, QTextBlockFormat const&, QTextLayoutStruct*, int, int, QTextBlockFormat const*)
      4908.0ms   43.8%	4908   43.8%	0.0	 	     QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::iterator, QTextLayoutStruct*, int, int, QFixed)
      4908.0ms   43.8%	4908   43.8%	0.0	 	      QTextDocumentLayoutPrivate::layoutFrame(QTextFrame*, int, int, QFixed, QFixed, QFixed)
      4908.0ms   43.8%	4908   43.8%	0.0	 	       QTextDocumentLayoutPrivate::layoutFrame(QTextFrame*, int, int, QFixed)
      4908.0ms   43.8%	4908   43.8%	0.0	 	        QTextDocumentLayout::doLayout(int, int, int)
      3921.0ms   35.0%	3921   35.0%	0.0	 	         QTextDocumentLayout::idealWidth() const
      3921.0ms   35.0%	3921   35.0%	0.0	 	          QQuickTextEdit::updateSize()
      

      Instruments trace part 2:

      Running Time	Samples	Self		Symbol Name
      1709.0ms   15.2%	1709   15.2%	1709.0	 	QVector<QPointF>::reallocData(int, int, QFlags<QArrayData::AllocationOption>)
      1709.0ms   15.2%	1709   15.2%	0.0	 	 (anonymous namespace)::SelectionEngine::addToSceneGraph(QQuickTextNode*, QQuickText::TextStyle, QColor const&)
      1709.0ms   15.2%	1709   15.2%	0.0	 	  QQuickTextNode::addTextDocument(QPointF const&, QTextDocument*, QColor const&, QQuickText::TextStyle, QColor const&, QColor const&, QColor const&, QColor const&, int, int)
      1709.0ms   15.2%	1709   15.2%	0.0	 	   QQuickTextEdit::updatePaintNode(QSGNode*, QQuickItem::UpdatePaintNodeData*)
      1709.0ms   15.2%	1709   15.2%	0.0	 	    QQuickWindowPrivate::updateDirtyNode(QQuickItem*)
      1709.0ms   15.2%	1709   15.2%	0.0	 	     QQuickWindowPrivate::syncSceneGraph()
      1709.0ms   15.2%	1709   15.2%	0.0	 	      QQuickRenderThreadSingleContextWindowManager::run()
      1709.0ms   15.2%	1709   15.2%	0.0	 	       QThreadPrivate::start(void*)
      0.0ms    0.0%	0    0.0%	0.0	 	        QQuickRenderThreadSingleContextWindowManager::run  0x5bf2d6
      

      Attachments

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              sorvig Morten Sørvig
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes