forked from qt-creator/qt-creator
ExtensionSystem: Include phase breakdown in profiling summary
Makes it easier to find where bottlenecks are, as a hint where to actually start profiling. Change-Id: I00b881583c2c25b13f6e287b39b6b83299ac6674 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -1803,10 +1803,11 @@ QString PluginManagerPrivate::profilingSummary(qint64 *totalOut) const
|
||||
if (!s->isEffectivelyEnabled())
|
||||
continue;
|
||||
const qint64 t = s->performanceData().total();
|
||||
summary += QString("%1 %2ms ( %3% )\n")
|
||||
summary += QString("%1 %2ms ( %3% ) (%4)\n")
|
||||
.arg(s->name(), -22)
|
||||
.arg(t, 8)
|
||||
.arg(100.0 * t / total, 5, 'f', 2);
|
||||
.arg(100.0 * t / total, 5, 'f', 2)
|
||||
.arg(s->performanceData().summary());
|
||||
}
|
||||
summary += QString("Total plugins: %1ms\n").arg(total, 8);
|
||||
summary += QString("Total startup: %1ms\n").arg(m_totalStartupMS, 8);
|
||||
|
@@ -61,6 +61,14 @@ struct EXTENSIONSYSTEM_EXPORT PerformanceData
|
||||
qint64 delayedInitialize = 0;
|
||||
|
||||
qint64 total() const { return load + initialize + extensionsInitialized + delayedInitialize; }
|
||||
QString summary() const
|
||||
{
|
||||
return QString("l: %1ms, i: %2ms, x: %3ms, d: %4ms")
|
||||
.arg(load, 3)
|
||||
.arg(initialize, 3)
|
||||
.arg(extensionsInitialized, 3)
|
||||
.arg(delayedInitialize, 3);
|
||||
}
|
||||
};
|
||||
|
||||
class EXTENSIONSYSTEM_EXPORT PluginSpec
|
||||
|
Reference in New Issue
Block a user