forked from qt-creator/qt-creator
ExtensionSystem: Add total real time to profiling report
The original total only contained the time spent inside of plugin
methods, but a lot of things get delayed arbitrarily to the event loop
currently. That is included in the new "total startup".
Task-number: QTCREATORBUG-29540
Change-Id: I832bb972d85bc4cf82f098e4cbf5d3ff3800d14a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 026848eadd
)
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -957,6 +957,8 @@ void PluginManagerPrivate::nextDelayedInitialize()
|
|||||||
m_isInitializationDone = true;
|
m_isInitializationDone = true;
|
||||||
delete delayedInitializeTimer;
|
delete delayedInitializeTimer;
|
||||||
delayedInitializeTimer = nullptr;
|
delayedInitializeTimer = nullptr;
|
||||||
|
if (m_profileTimer)
|
||||||
|
m_totalStartupMS = m_profileTimer->elapsed();
|
||||||
profilingSummary();
|
profilingSummary();
|
||||||
emit q->initializationDone();
|
emit q->initializationDone();
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
@@ -1814,7 +1816,8 @@ void PluginManagerPrivate::profilingSummary() const
|
|||||||
const qint64 t = s->performanceData().total();
|
const qint64 t = s->performanceData().total();
|
||||||
qDebug("%-22s %8lldms ( %5.2f%% )", qPrintable(s->name()), t, 100.0 * t / total);
|
qDebug("%-22s %8lldms ( %5.2f%% )", qPrintable(s->name()), t, 100.0 * t / total);
|
||||||
}
|
}
|
||||||
qDebug("Total: %8lldms", total);
|
qDebug("Total plugins: %8lldms", total);
|
||||||
|
qDebug("Total startup: %8lldms", m_totalStartupMS);
|
||||||
Utils::Benchmarker::report("loadPlugins", "Total", total);
|
Utils::Benchmarker::report("loadPlugins", "Total", total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -107,6 +107,8 @@ public:
|
|||||||
QStringList argumentsForRestart;
|
QStringList argumentsForRestart;
|
||||||
QScopedPointer<QElapsedTimer> m_profileTimer;
|
QScopedPointer<QElapsedTimer> m_profileTimer;
|
||||||
qint64 m_profileElapsedMS = 0;
|
qint64 m_profileElapsedMS = 0;
|
||||||
|
qint64 m_totalUntilDelayedInitialize = 0;
|
||||||
|
qint64 m_totalStartupMS = 0;
|
||||||
unsigned m_profilingVerbosity = 0;
|
unsigned m_profilingVerbosity = 0;
|
||||||
Utils::QtcSettings *settings = nullptr;
|
Utils::QtcSettings *settings = nullptr;
|
||||||
Utils::QtcSettings *globalSettings = nullptr;
|
Utils::QtcSettings *globalSettings = nullptr;
|
||||||
|
Reference in New Issue
Block a user