Guiliani  Version 2.5 revision 7293 (documentation build 13)
Profiling

Overview

When using Guiliani you will have various profiling-options available for your application:

  • CPU-Usage
  • Memory-Consumption
  • Invalidations
  • Durations for Graphics
  • FPS-Measurement

The central object to use profiling in your application is CGUIProfiler. Here you can activate different profiling-options. The output can be the screen and/or the console.

Output-Modes

There are two different output-modes:

  • activate output to the screen (e.g. if no console-output is available on the platform) with GETPROFILER.SetDisplayActive()
  • send the output to the console via Guiliani-Logging use GETPROFILER.SetConsoleActive()

Profiling Options

CPU-Usage

Profiling CPU-Usage is activated by using GETPROFILER.SetCPUUsageActive()

Memory-Consumption

Profiling Memory-Consumption is activated by using GETPROFILER.SetMemoryProfilingActive() Memory-Profiling in Guiliani will use the MemLeakDetection-feature of Guiliani which will track all memory-allocations and -deallocations.

Depending on the available features of your platform there are two scenarios:

  • it will track only memory-consumption in Guiliani and designated modules of your application (i.e. all files including the file "GUIMemLeakWatcher.h" will use redefined new/delete-operators)
  • it will track every call to new/delete if using globally overloaded new-/delete-operators

both profiling-options will differ in the actual usage they will display. this is due to the fact that when using globally redefined new-/delete-operators ALL memory will be count. Compared to the included-based option which will only redefine new-/delete-operators for this module.

Invalidations

Profiling Invalidations (i.e. marking the areas of the screen which have been redrawn) is activated by GETPROFILER.SetInvalidationActive() If activated it will mark all areas which have been redrawn in alternating colors, so you can see it there has been recently a redraw of this area.

Graphics

Profiling Graphics is activated by using GETPROFILER.SetGraphicsProfilingActive() and will tell you how much has been necessary for Redraw and Refresh.

sec_profiling_display

To modify the on-screen-display of profiling the following is available

  • update-interval in milliseconds
  • text- and background-color
  • font
  • position

Additionally to the text which is displayed on the screen you can activate the memory-bar which will show the currently used and maximum memory. To activate it use GETPROFILER.SetMemoryUsageBarActive(). The position and size can be set seperately with SetMemoryUsageBarPosition() and SetMemoryUsageBarSize()

The following example shows the constructor of a class CMyGUI that is derived from CGUI:

CMyGUI::CMyGUI(
eC_Value x, eC_Value y, // upper left corner
eC_Value width, eC_Value height, // size
:
CGUI(x, y, width, height, eID)
{
Init();
}
ObjectHandle_t
List of object resource ids.
Definition: GUIObjectHandleResource.h:55
GUI base class for any Guiliani application.
Definition: GUI.h:47