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>
This commit is contained in:
Eike Ziller
2023-08-28 16:21:39 +02:00
parent 4da8430cab
commit 026848eadd
2 changed files with 6 additions and 1 deletions

View File

@@ -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);
}
}

View File

@@ -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;