Tracy is C++ frame profiler and can be downloaded here.
Tracy supports profiling CPU, threading, memory, locks, context switches, and more. It's integrated into Flax and can be used to profile both game and engine in Editor or in cooked build (Debug or Development configurations).
Profiling Editor with Tracy after scripting hot-reload is not supported. Can be optionally enabled in custom engine build with
PROFILE_CPU_USE_TRANSIENT_DATA set to
Download latest Tracy from Github releases, extract
Tracy-<version>.7z file and run Tracy.exe. It will show active Flax. Double-click to connect and start collecting profiling data.
Use Tracy.pdf manual to learn more about profiling and performance measurements.
Use Flax API to inject profile blocks:
#include "Engine/Profiler/ProfilerCPU.h" PROFILE_CPU(); // do some stuff
Profiler.BeginEvent("MyFunc"); // do some stuff Profiler.EndEvent();
Automated data collection
Tracy supports automatic instrumentation of the profiled code without injecting the profiler sections/macros. To do so run Flax with admin rights (privilege elevation). In this mode, Tracy will also capture the CPU cores usage by other processes and will allow for more complex application profiling.
Flax automatically captures the callstack for memory allocations and frees. This can be used in Tracy profiler app to analyze memory usage.