diff options
author | Eike Ziller <eike.ziller@qt.io> | 2023-08-28 16:21:39 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2023-09-25 07:11:49 +0000 |
commit | aa4ff49f83869d543f656acf96b9f236555cc893 (patch) | |
tree | d94f8c42f789b565794903dadc0ec543b5502f50 | |
parent | 0c104914ab25d233d16c32f159ba99257350c872 (diff) |
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 026848eaddf377b70d42ddf13ec15fe1f73d3b0a)
Reviewed-by: hjk <hjk@qt.io>
-rw-r--r-- | src/libs/extensionsystem/pluginmanager.cpp | 5 | ||||
-rw-r--r-- | src/libs/extensionsystem/pluginmanager_p.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 5fa8b4a8cf..0f242ce1c1 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -957,6 +957,8 @@ void PluginManagerPrivate::nextDelayedInitialize() m_isInitializationDone = true; delete delayedInitializeTimer; delayedInitializeTimer = nullptr; + if (m_profileTimer) + m_totalStartupMS = m_profileTimer->elapsed(); profilingSummary(); emit q->initializationDone(); #ifdef WITH_TESTS @@ -1814,7 +1816,8 @@ void PluginManagerPrivate::profilingSummary() const const qint64 t = s->performanceData().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); } } diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index 75197013a8..4b5f45cccb 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -107,6 +107,8 @@ public: QStringList argumentsForRestart; QScopedPointer<QElapsedTimer> m_profileTimer; qint64 m_profileElapsedMS = 0; + qint64 m_totalUntilDelayedInitialize = 0; + qint64 m_totalStartupMS = 0; unsigned m_profilingVerbosity = 0; Utils::QtcSettings *settings = nullptr; Utils::QtcSettings *globalSettings = nullptr; |