Performance markers

Overview

Gameface can emit performance markers, letting you observe a timeline of the most important UI processing events and their duration.

This page mainly relates to the APIs or techniques specific to the Gameface Unreal Engine plugin and integration. It is highly recommended that you read the native Gameface performance markers documentation for an extended overview and more engine-agnostic performance optimization techniques.

How to use

Enabling or disabling the performance markers in Unreal Engine is very straightforward:

  1. (optional) Ensure that the cohtml::Library has been initialized. This should already be true when launching your project since it is initialized with the CohtmlPlugin module startup.
  2. Call the ICohtmlPlugin::Get().EnableProfiling(bool bEnabled = true) method to start your performance tracing at a convenient time. For example, this could be right after loading a new URL page to your View.
  3. Stop tracing when convenient - this can be done by simply calling ICohtmlPlugin::Get().EnableProfiling(false)
  4. Observe your performance markers. On desktop platforms which use minitrace, such as Windows, this would require finding a trace file (Game/Saved/Cohtml/profiling/trace.json by default) and opening it via chrome://tracing/ or Perfetto. For more information check out the native documentation

Details

There are a couple of other configurable options related to performance markers:

  • You can configure the path where your trace file is saved, using ICohtmlPlugin::Get().EnableProfiling()’s TraceFilePath parameter.
  • You can configure the level of detail of the performance markers, using ICohtmlPlugin::Get().EnableProfiling()’s TraceLevel parameter. There are currently two options - either emit only “basic markers”, or “all markers”. Emitting basic markers is the default (and preferred) value, with “all markers” being the less performant and more verbose option.