Home

Awesome

Optick: C++ Profiler For Games

GitHub GitHub release <br/> Optick is a super-lightweight C++ profiler for Games.<br/> It provides access for all the necessary tools required for efficient performance analysis and optimization:<br/> instrumentation, switch-contexts, sampling, GPU counters.<br/>

Looking for 'Brofiler'? It has been renamed to 'Optick', so you are in the right place.

Build Status

Windows (x64: msvc)Linux (x64: clang, gcc)MacOS (x64: clang, gcc)Static Code Analysis
Windows Build statusLinux+MacOS Build StatusLinux+MacOS Build StatusTotal alerts Codacy Badge
FeaturesWindowsLinuxMacOSXBoxPS4UE4
Instrumentation:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::grey_question::heavy_check_mark:
Switch Contexts:heavy_check_mark: ETW:heavy_check_mark: FTrace:heavy_check_mark: DTrace:heavy_check_mark::grey_question::heavy_check_mark: Win
Sampling:heavy_check_mark: ETW:grey_question::grey_question::heavy_check_mark: Win
GPU:heavy_check_mark: D3D12, Vulkan:heavy_check_mark: Vulkan:heavy_check_mark: Vulkan:hourglass_flowing_sand:

:heavy_check_mark: - works out of the box, :hourglass_flowing_sand: - in progress, :grey_question: - coming soon for the certified developers

List of Games and Studios using Optick(Brofiler)

Allods Team 4A Games CryEngine Larian Studios Skyforge Metro Exodus Warface Armored Warfare

Video Tutorial

Optick Video Tutorial

Basic Integration (one line of code)

  1. Copy 'src' folder from the repository or latest release to your game project
  2. Add OPTICK_FRAME("MainThread"); macro to the main loop of your game and #include "optick.h" header
#include "optick.h"
...
while( true ) 
{
	OPTICK_FRAME("MainThread");
	engine.Update();
}
  1. Use OPTICK_EVENT(); macro to instrument a function
void SlowFunction()
{ 
	OPTICK_EVENT();
	...
}
  1. Add OPTICK_THREAD("Name"); macro to declare a new thread with Optick
void WorkerThread(...)
{
	OPTICK_THREAD("Worker");
	while (isRunning)
	{
		...
	}
}
  1. Edit optick.config.h to enable/disable some of the features in specific configs or platforms.<br/>(e.g. disabling Optick in final builds)

:warning: If your Game uses dynamic linking and you are planning to use Optick from multiple dlls within the same executable - please make sure that Optick's code is added to the common Dynamic Library and this library is compiled with OPTICK_EXPORT define (Static Library won't work).<br/> You could also use precompiled OptickCore.dll which is packaged with every release:

API

All the available API calls are documented here:<br/> https://github.com/bombomby/optick/wiki/Optick-API

Unreal Engine

Optick provides a special plugin for UE4. Check more detailed documentation here: <br/> https://github.com/bombomby/optick/wiki/UE4-Optick-Plugin <br/> https://github.com/bombomby/optick/wiki/UE5-Optick-Plugin <br/>

Samples

Run GenerateProjects_gpu.bat to generate project files. To compile the samples you'll need to install VulkanSDK. Alternatively you could use GenerateProjects.bat to generate only minimal solution with ConsoleApp sample.<br/> Open solution build\vs2017\Optick.sln with generated samples.

WindowsD3D12WindowsVulkanConsoleApp
WindowsD3D12WindowsVulkanConsoleApp
DirectX12 multithreading sample with Optick integrationSaschaWillems's vulkan multithreading sample with Optick integrationBasic ConsoleApp with Optick integration (Windows, Linux, MacOS)

Brofiler

Brofiler has been renamed into Optick starting from v1.2.0.<br/> All the future development is going under the new name.<br/> Cheatsheet for upgrading to the new version:

How To Start?

You can find a short instruction here:<br/> https://github.com/bombomby/optick/wiki/How-to-start%3F-(Programmers-Setup)