From aa4ff49f83869d543f656acf96b9f236555cc893 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 28 Aug 2023 16:21:39 +0200 Subject: 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 (cherry picked from commit 026848eaddf377b70d42ddf13ec15fe1f73d3b0a) Reviewed-by: hjk --- 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 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 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; -- cgit v1.2.3