From 026848eaddf377b70d42ddf13ec15fe1f73d3b0a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 28 Aug 2023 16:21:39 +0200 Subject: [PATCH] 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: Reviewed-by: Cristian Adam Reviewed-by: Qt CI Bot --- src/libs/extensionsystem/pluginmanager.cpp | 5 ++++- src/libs/extensionsystem/pluginmanager_p.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 7f28a94bbac..a0a4d3d8c7b 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -945,6 +945,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 @@ -1802,7 +1804,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 75197013a8b..4b5f45cccbc 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -107,6 +107,8 @@ public: QStringList argumentsForRestart; QScopedPointer 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;