pure-cpp 1.0.0
A C++ physics simulation benchmark comparing performance with Python implementations
AppUtils::AppProfiler Class Reference

Global application profiler for measuring non-physics phases. More...

#include <app_profiler.hpp>

Collaboration diagram for AppUtils::AppProfiler:
Collaboration graph

Public Types

using Clock = std::chrono::high_resolution_clock
 
using TimePoint = Clock::time_point
 

Static Public Member Functions

static void startQtInit ()
 Starts timing Qt initialization. More...
 
static void stopQtInit ()
 Stops timing Qt initialization. More...
 
static void startWindowCreation ()
 Starts timing 3D window creation. More...
 
static void stopWindowCreation ()
 Stops timing 3D window creation. More...
 
static void startFrameRender ()
 Starts timing a frame render. More...
 
static void stopFrameRender ()
 Stops timing a frame render. More...
 
static void startEventLoop ()
 Starts timing the Qt event loop. More...
 
static void stopEventLoop ()
 Stops timing the Qt event loop. More...
 
static void startCleanup ()
 Starts timing cleanup. More...
 
static void stopCleanup ()
 Stops timing cleanup. More...
 
static void addCleanupDisplayPrep (double seconds)
 Adds measured time for Display cleanup preparation. More...
 
static void addCleanupDisplayProcessEvents (double seconds)
 Adds measured time spent in Display cleanup processEvents. More...
 
static void addCleanupDisplayThreadStop (double seconds)
 Adds measured time for stopping the physics thread. More...
 
static void addCleanupDisplayWorkerCleanup (double seconds)
 Adds measured time for physics worker cleanup. More...
 
static void addCleanupAppBridgeCleanup (double seconds)
 Adds measured time spent in bridge/display cleanup call. More...
 
static void addCleanupAppManualDestroy (double seconds)
 Adds measured time for manual destroy operations. More...
 
static void addCleanupAppDetachContainer (double seconds)
 Adds measured time for detaching the display container. More...
 
static void addCleanupAppReleaseDisplay (double seconds)
 Adds measured time for explicit display release. More...
 
static void addCleanupAppContainerDeleteSchedule (double seconds)
 Adds measured time for container delete action. More...
 
static void addCleanupAppProcessEvents (double seconds)
 Adds measured time spent in AppManager cleanup processEvents. More...
 
static void printReport ()
 Prints the profiling report. More...
 
static void reset ()
 Resets all profiling data. More...
 

Private Member Functions

 AppProfiler (const AppProfiler &)=delete
 
AppProfileroperator= (const AppProfiler &)=delete
 

Static Private Member Functions

static AppProfilerinstance ()
 

Private Attributes

double qtInitTime_ = 0.0
 
double windowCreationTime_ = 0.0
 
double eventLoopTime_ = 0.0
 
double frameRenderTime_ = 0.0
 
double cleanupTime_ = 0.0
 
double cleanupDisplayPrepTime_ = 0.0
 
double cleanupDisplayProcessEventsTime_ = 0.0
 
double cleanupDisplayThreadStopTime_ = 0.0
 
double cleanupDisplayWorkerCleanupTime_ = 0.0
 
double cleanupAppBridgeCleanupTime_ = 0.0
 
double cleanupAppManualDestroyTime_ = 0.0
 
double cleanupAppProcessEventsTime_ = 0.0
 
double cleanupAppDetachContainerTime_ = 0.0
 
double cleanupAppReleaseDisplayTime_ = 0.0
 
double cleanupAppContainerDeleteScheduleTime_ = 0.0
 
std::size_t frameRenderCount_ = 0
 
TimePoint qtInitStart_ {}
 
TimePoint windowCreationStart_ {}
 
TimePoint eventLoopStart_ {}
 
TimePoint frameRenderStart_ {}
 
TimePoint cleanupStart_ {}
 

Detailed Description

Global application profiler for measuring non-physics phases.

This class accumulates timing data for application-wide operations that are not part of the physics simulation itself.

Definition at line 26 of file app_profiler.hpp.

Member Typedef Documentation

◆ Clock

using AppUtils::AppProfiler::Clock = std::chrono::high_resolution_clock

Definition at line 28 of file app_profiler.hpp.

◆ TimePoint

using AppUtils::AppProfiler::TimePoint = Clock::time_point

Definition at line 29 of file app_profiler.hpp.

Member Function Documentation

◆ addCleanupAppBridgeCleanup()

static void AppUtils::AppProfiler::addCleanupAppBridgeCleanup ( double  seconds)
inlinestatic

Adds measured time spent in bridge/display cleanup call.

Definition at line 164 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ addCleanupAppContainerDeleteSchedule()

static void AppUtils::AppProfiler::addCleanupAppContainerDeleteSchedule ( double  seconds)
inlinestatic

Adds measured time for container delete action.

In fast mode this is deleteLater() scheduling, in strict mode this is immediate deletion.

Definition at line 198 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ addCleanupAppDetachContainer()

static void AppUtils::AppProfiler::addCleanupAppDetachContainer ( double  seconds)
inlinestatic

Adds measured time for detaching the display container.

Definition at line 181 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ addCleanupAppManualDestroy()

static void AppUtils::AppProfiler::addCleanupAppManualDestroy ( double  seconds)
inlinestatic

Adds measured time for manual destroy operations.

This phase includes detach-from-window, display release and container deletion, but excludes processEvents.

Definition at line 174 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ addCleanupAppProcessEvents()

static void AppUtils::AppProfiler::addCleanupAppProcessEvents ( double  seconds)
inlinestatic

Adds measured time spent in AppManager cleanup processEvents.

Definition at line 205 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ addCleanupAppReleaseDisplay()

static void AppUtils::AppProfiler::addCleanupAppReleaseDisplay ( double  seconds)
inlinestatic

Adds measured time for explicit display release.

Definition at line 188 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ addCleanupDisplayPrep()

static void AppUtils::AppProfiler::addCleanupDisplayPrep ( double  seconds)
inlinestatic

Adds measured time for Display cleanup preparation.

This phase includes stopping timers, disconnecting signals and stopping simulation scheduling.

Definition at line 136 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ addCleanupDisplayProcessEvents()

static void AppUtils::AppProfiler::addCleanupDisplayProcessEvents ( double  seconds)
inlinestatic

Adds measured time spent in Display cleanup processEvents.

Definition at line 143 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ addCleanupDisplayThreadStop()

static void AppUtils::AppProfiler::addCleanupDisplayThreadStop ( double  seconds)
inlinestatic

Adds measured time for stopping the physics thread.

Definition at line 150 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ addCleanupDisplayWorkerCleanup()

static void AppUtils::AppProfiler::addCleanupDisplayWorkerCleanup ( double  seconds)
inlinestatic

Adds measured time for physics worker cleanup.

Definition at line 157 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ instance()

static AppProfiler & AppUtils::AppProfiler::instance ( )
inlinestaticprivate

Definition at line 353 of file app_profiler.hpp.

◆ printReport()

static void AppUtils::AppProfiler::printReport ( )
inlinestatic

Prints the profiling report.

Definition at line 212 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ reset()

static void AppUtils::AppProfiler::reset ( )
inlinestatic

Resets all profiling data.

Definition at line 322 of file app_profiler.hpp.

◆ startCleanup()

static void AppUtils::AppProfiler::startCleanup ( )
inlinestatic

Starts timing cleanup.

Definition at line 115 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ startEventLoop()

static void AppUtils::AppProfiler::startEventLoop ( )
inlinestatic

Starts timing the Qt event loop.

Definition at line 95 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ startFrameRender()

static void AppUtils::AppProfiler::startFrameRender ( )
inlinestatic

Starts timing a frame render.

Definition at line 73 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ startQtInit()

static void AppUtils::AppProfiler::startQtInit ( )
inlinestatic

Starts timing Qt initialization.

Definition at line 34 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ startWindowCreation()

static void AppUtils::AppProfiler::startWindowCreation ( )
inlinestatic

Starts timing 3D window creation.

Definition at line 52 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ stopCleanup()

static void AppUtils::AppProfiler::stopCleanup ( )
inlinestatic

Stops timing cleanup.

Definition at line 120 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ stopEventLoop()

static void AppUtils::AppProfiler::stopEventLoop ( )
inlinestatic

Stops timing the Qt event loop.

Definition at line 102 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ stopFrameRender()

static void AppUtils::AppProfiler::stopFrameRender ( )
inlinestatic

Stops timing a frame render.

Definition at line 80 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ stopQtInit()

static void AppUtils::AppProfiler::stopQtInit ( )
inlinestatic

Stops timing Qt initialization.

Definition at line 39 of file app_profiler.hpp.

Here is the caller graph for this function:

◆ stopWindowCreation()

static void AppUtils::AppProfiler::stopWindowCreation ( )
inlinestatic

Stops timing 3D window creation.

Definition at line 59 of file app_profiler.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ cleanupAppBridgeCleanupTime_

double AppUtils::AppProfiler::cleanupAppBridgeCleanupTime_ = 0.0
private

Definition at line 367 of file app_profiler.hpp.

◆ cleanupAppContainerDeleteScheduleTime_

double AppUtils::AppProfiler::cleanupAppContainerDeleteScheduleTime_ = 0.0
private

Definition at line 372 of file app_profiler.hpp.

◆ cleanupAppDetachContainerTime_

double AppUtils::AppProfiler::cleanupAppDetachContainerTime_ = 0.0
private

Definition at line 370 of file app_profiler.hpp.

◆ cleanupAppManualDestroyTime_

double AppUtils::AppProfiler::cleanupAppManualDestroyTime_ = 0.0
private

Definition at line 368 of file app_profiler.hpp.

◆ cleanupAppProcessEventsTime_

double AppUtils::AppProfiler::cleanupAppProcessEventsTime_ = 0.0
private

Definition at line 369 of file app_profiler.hpp.

◆ cleanupAppReleaseDisplayTime_

double AppUtils::AppProfiler::cleanupAppReleaseDisplayTime_ = 0.0
private

Definition at line 371 of file app_profiler.hpp.

◆ cleanupDisplayPrepTime_

double AppUtils::AppProfiler::cleanupDisplayPrepTime_ = 0.0
private

Definition at line 363 of file app_profiler.hpp.

◆ cleanupDisplayProcessEventsTime_

double AppUtils::AppProfiler::cleanupDisplayProcessEventsTime_ = 0.0
private

Definition at line 364 of file app_profiler.hpp.

◆ cleanupDisplayThreadStopTime_

double AppUtils::AppProfiler::cleanupDisplayThreadStopTime_ = 0.0
private

Definition at line 365 of file app_profiler.hpp.

◆ cleanupDisplayWorkerCleanupTime_

double AppUtils::AppProfiler::cleanupDisplayWorkerCleanupTime_ = 0.0
private

Definition at line 366 of file app_profiler.hpp.

◆ cleanupStart_

TimePoint AppUtils::AppProfiler::cleanupStart_ {}
private

Definition at line 379 of file app_profiler.hpp.

◆ cleanupTime_

double AppUtils::AppProfiler::cleanupTime_ = 0.0
private

Definition at line 362 of file app_profiler.hpp.

◆ eventLoopStart_

TimePoint AppUtils::AppProfiler::eventLoopStart_ {}
private

Definition at line 377 of file app_profiler.hpp.

◆ eventLoopTime_

double AppUtils::AppProfiler::eventLoopTime_ = 0.0
private

Definition at line 360 of file app_profiler.hpp.

◆ frameRenderCount_

std::size_t AppUtils::AppProfiler::frameRenderCount_ = 0
private

Definition at line 373 of file app_profiler.hpp.

◆ frameRenderStart_

TimePoint AppUtils::AppProfiler::frameRenderStart_ {}
private

Definition at line 378 of file app_profiler.hpp.

◆ frameRenderTime_

double AppUtils::AppProfiler::frameRenderTime_ = 0.0
private

Definition at line 361 of file app_profiler.hpp.

◆ qtInitStart_

TimePoint AppUtils::AppProfiler::qtInitStart_ {}
private

Definition at line 375 of file app_profiler.hpp.

◆ qtInitTime_

double AppUtils::AppProfiler::qtInitTime_ = 0.0
private

Definition at line 358 of file app_profiler.hpp.

◆ windowCreationStart_

TimePoint AppUtils::AppProfiler::windowCreationStart_ {}
private

Definition at line 376 of file app_profiler.hpp.

◆ windowCreationTime_

double AppUtils::AppProfiler::windowCreationTime_ = 0.0
private

Definition at line 359 of file app_profiler.hpp.


The documentation for this class was generated from the following file: