Page:
Profiler
Pages
Animation
Asset browser
Audio
Available plugins
Basis Universal
Building 3rd party libraries
Case sensitive filesystems
Code rules
Command line
Custom plugin
Exporting game
Features
Filesystem
Getting started
Home
Hot reload
How to move from Unity to Lumix
Importing assets
Ingame GUI
Knowledge base
Latency
List of free assets
Lua scripting
Native Scripting
Navigation
Particle system
Physics
Plugin hotreload
Profiler
Resource UID
Terrain
Video tutorials
Writing a postprocess effect
12
Profiler
Mikulas Florek edited this page 2021-03-13 10:23:33 +01:00
Table of Contents
The profiler reports how much time is spent in different parts of engine. This is very helpful when you want to optimize your game. Parts of the engine you want to track must be marked by following macros:
- PROFILE_FUNCTION
- PROFILE_BLOCK
Profiler window
void Material::apply(Renderer& renderer, PipelineInstance& pipeline) const
{
PROFILE_FUNCTION();
Once the profiler is recording there is a very small overhead for each record.
Profiling values
Other than tracking time profiler can be used to track integer or string values
void renderMeshes(const Array<RenderableMesh>& meshes)
{
PROFILE_FUNCTION();
if (meshes.empty()) return;
Renderable* renderables = m_scene->getRenderables();
Profiler::pushInt("mesh count", meshes.size());
Profiler::pushString("some msg");
If the Profiler::pushInt is called several times per frame, the resulting value is the sum of all calls.