This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Microprofile

UNIGINE has support for Microprofile, an advanced external embeddable CPU/GPU profiler with support for per-frame inspection.

Microprofile Tool

The profiler features the following:

  • Profiling operations performed by the engine on CPU and GPU.
  • Profiling the engine threads.
  • Profiling up to 1000 frames.
  • The performance data output to a local web server or to an HTML/CSV file.

Running Microprofile

Notice
The Microprofile is available only for the development builds of UNIGINE Engine: it won't be compiled for the debug and release ones. You can use the microprofile_info console command to check if the Microprofile is compiled.

The performance data obtained by the Microprofile can be output to a local web server or to an HTML/CSV file.

Notice
The Microprofiler shows valid information only after the first 1000 frames are rendered (e.g. at the framerate of 60 FPS, such “warmup” time comprises about 16 seconds).

Visualization Using Built-In Server

To visualize the performance data using the local web server, perform the following:

  1. In the console, set the the number of frames to be profiled via the microprofile_webserver_frames console command. You can skip this step: by default, 500 frames will be profiled.
  2. If required, disable GPU profiling.
  3. On the Menu Bar of UnigineEditor, choose Tools -> Microprofile.

The performance data will be displayed in your Web browser.

Notice
You can display only a part of the profiled frames: in the Web browser address bar, add /<number_of_frames> to the current URL.
For example, if you specify localhost:1337/100, only the first 100 frames will be displayed.

Visualization Using Files

To output the performance data to the HTML/CSV files, perform the following:

  1. In the console, set the the number of frames to be profiled via the microprofile_dump_frames console command. You can skip this step: by default, 1000 frames will be profiled.
  2. If required, disable GPU profiling.
  3. Run the microprofile_dump_csv or microprofile_dump_html console command.

The performance data will be saved to the specified .csv or .html file.

Using profiling dumps simplifies capturing performance "spikes": the engine continues rendering the application in the background even when it is out of focus, so the frame where the spike has occurred can be overwritten in case of using the Web server for performance data visualization. Also it can be used to estimate the optimization results: you can dump frames before and after optimization and compare them.

Notice
All available console commands can be found in the Performance Profiling section of the article on Console.

Performance Data

The Microprofile visualizes the detailed per frame performance data on the operations performed by the engine on CPU and GPU (if enabled) and on the engine threads. In the Microprofile main menu, you can change the visialization mode: click Mode and choose the required one. By default, the Detailed mode is set.

Profiling Groups Displayed in Detailed Mode

In the Detailed mode, each operation (function) and thread is displayed as a separate colored region. The regions are hierarchical: the function called by the other function is displayed under the last one. The size of the region is determined by the time the corresponding operation takes.

In the picture below, the Engine::do_render() function calls the RenderRenderer::renderWorld() functions and so on:

To view the data on a certain operation or a thread, point to the corresponding region. To zoom in/out the displayed regions, scroll the mouse wheel.

CPU Data

In the Main group of the performance data, the call stack of the operations (e.g., update, rendering, etc.) performed by the engine on CPU is displayed.

Performance Data on World Update Function

GPU Data

In the GPU group of the performance data, the call stack of the operations performed by the engine on GPU is displayed. In addition to the main performance data, for each function (e.g. environment rendering, post materials rendering and so on), the number of DIP calls and rendered triangles is shown. Also there can be the number of surfaces, lights, shadows rendered by this function, the number of materials and shaders used; the information on the node or material for which the function is called (identifier, name, etc.).

Performance Data on Deferred Lighting Rendering

When the region that corresponds to the certain function is pointed, the Microprofile displays when this function is called on CPU and how much time is spent on its performing.

Engine Threads Data

The performance data on the engine threads is visualized in the CPUThread, SoundThread, AsyncQueueThread, WorldSpawnMeshClutterThread, WorldSpawnGrassThread groups.

Performance Data on Physics Thread
Last update: 2018-08-10
Build: ()