forked from qt-creator/qt-creator
CppEditor: Add timing information for semantic highlighting
Change-Id: If53fd8c8895916a613629628b4555983c0d76ce6 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
#include <QElapsedTimer>
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
|
|
||||||
@@ -165,6 +166,8 @@ void SemanticHighlighter::onHighlighterResultAvailable(int from, int to)
|
|||||||
return; // aborted
|
return; // aborted
|
||||||
|
|
||||||
qCDebug(log) << "onHighlighterResultAvailable()" << from << to;
|
qCDebug(log) << "onHighlighterResultAvailable()" << from << to;
|
||||||
|
QElapsedTimer t;
|
||||||
|
t.start();
|
||||||
|
|
||||||
SyntaxHighlighter *highlighter = m_baseTextDocument->syntaxHighlighter();
|
SyntaxHighlighter *highlighter = m_baseTextDocument->syntaxHighlighter();
|
||||||
QTC_ASSERT(highlighter, return);
|
QTC_ASSERT(highlighter, return);
|
||||||
@@ -234,11 +237,17 @@ void SemanticHighlighter::onHighlighterResultAvailable(int from, int to)
|
|||||||
}
|
}
|
||||||
if (parentheses.first.isValid())
|
if (parentheses.first.isValid())
|
||||||
TextDocumentLayout::setParentheses(parentheses.first, parentheses.second);
|
TextDocumentLayout::setParentheses(parentheses.first, parentheses.second);
|
||||||
|
|
||||||
|
qCDebug(log) << "onHighlighterResultAvailable() took" << t.elapsed() << "ms";
|
||||||
}
|
}
|
||||||
|
|
||||||
void SemanticHighlighter::onHighlighterFinished()
|
void SemanticHighlighter::onHighlighterFinished()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_watcher, return);
|
QTC_ASSERT(m_watcher, return);
|
||||||
|
|
||||||
|
QElapsedTimer t;
|
||||||
|
t.start();
|
||||||
|
|
||||||
if (!m_watcher->isCanceled() && documentRevision() == m_revision) {
|
if (!m_watcher->isCanceled() && documentRevision() == m_revision) {
|
||||||
SyntaxHighlighter *highlighter = m_baseTextDocument->syntaxHighlighter();
|
SyntaxHighlighter *highlighter = m_baseTextDocument->syntaxHighlighter();
|
||||||
if (QTC_GUARD(highlighter)) {
|
if (QTC_GUARD(highlighter)) {
|
||||||
@@ -273,6 +282,7 @@ void SemanticHighlighter::onHighlighterFinished()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_watcher.reset();
|
m_watcher.reset();
|
||||||
|
qCDebug(log) << "onHighlighterFinished() took" << t.elapsed() << "ms";
|
||||||
}
|
}
|
||||||
|
|
||||||
void SemanticHighlighter::connectWatcher()
|
void SemanticHighlighter::connectWatcher()
|
||||||
|
|||||||
Reference in New Issue
Block a user