diff options
author | Kaj Grönholm <kaj.gronholm@qt.io> | 2019-12-05 08:13:05 +0200 |
---|---|---|
committer | Kaj Grönholm <kaj.gronholm@qt.io> | 2019-12-09 10:42:56 +0200 |
commit | 51a30b170d181c30804b1a8d6a9da2ad95dd1033 (patch) | |
tree | 20c05f55a0d83dbad0d8ea374986bb48cfd1b8c9 /src/engine/Qt3DSRuntimeView.cpp | |
parent | 9b684e9b943c089638451035691e08c53539c682 (diff) |
Improve perf logging #2
Improve startup perf logging, including:
- Move outputting startup perf logs into better place. Previously
only part of the logs were printed as output happened too soon,
now printing at first frame rendering.
- Show also amount of calls and cumulative timestamps.
- Improve log labels formatting.
- Add more logging points into hot spots.
Task-number: QT3DS-4021
Change-Id: I7db5a11ff10be1ccb691f82b10161e8ba7c316a6
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/engine/Qt3DSRuntimeView.cpp')
-rw-r--r-- | src/engine/Qt3DSRuntimeView.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/engine/Qt3DSRuntimeView.cpp b/src/engine/Qt3DSRuntimeView.cpp index 0a8fd54..bc48866 100644 --- a/src/engine/Qt3DSRuntimeView.cpp +++ b/src/engine/Qt3DSRuntimeView.cpp @@ -52,6 +52,7 @@ #include "Qt3DSDLLManager.h" #include "foundation/Qt3DSSimpleTypes.h" #include "foundation/TrackingAllocator.h" +#include "foundation/Qt3DSPerfTimer.h" // For perf log timestamp #include <time.h> #include "Qt3DSArray.h" @@ -397,8 +398,16 @@ void CRuntimeView::Render() m_Application->UpdateAndRender(); if (m_startupTime < 0 && m_startupTimer && m_startupTimer->isValid()) { - m_startupTime = m_startupTimer->elapsed(); - m_startupTimer->invalidate(); + { + QT3DS_PERF_SCOPED_TIMER(m_Application.mPtr->GetRuntimeFactoryCore() + .GetPerfTimer(), "RuntimeView: Stopping startup timer") + m_startupTime = m_startupTimer->elapsed(); + m_startupTimer->invalidate(); + } + + // Output startup perf logging data + m_Application->OutputPerfLoggingData(); + qCDebug(PERF_INFO, "RuntimeView: First frame at - %dms", m_startupTime); } |