t.HitchDeadTimeWindow

t.HitchDeadTimeWindow

#Overview

name: t.HitchDeadTimeWindow

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of t.HitchDeadTimeWindow is to define the minimum time that must pass before a new hitch (frame time spike) can be recorded in Unreal Engine’s performance monitoring system. It helps prevent the system from recording multiple hitches for a single event that spans multiple frames.

This setting variable is primarily used by the Engine’s performance monitoring subsystem, specifically within the EnginePerformanceTargets module. It’s part of the engine’s scalability features, as indicated by the ECVF_Scalability flag.

The value of this variable is set as a console variable with a default value of 200.0 milliseconds. It can be adjusted at runtime through the console or configuration files.

The associated variable GHitchDeadTimeWindowCVar interacts directly with t.HitchDeadTimeWindow. It’s a TAutoConsoleVariable that wraps the console command, providing a C++ interface to access the value.

Developers should be aware that this variable affects how frequently hitches are recorded. Setting it too low might result in over-reporting of hitches, while setting it too high might miss important performance issues.

Best practices when using this variable include:

  1. Adjusting it based on the specific performance characteristics of your game.
  2. Using it in conjunction with other performance monitoring tools to get a comprehensive view of your game’s performance.
  3. Consider different values for different platforms or performance modes.

Regarding the associated variable GHitchDeadTimeWindowCVar:

When working with GHitchDeadTimeWindowCVar, developers should be aware that changes to this variable will immediately affect the engine’s hitch detection behavior. It’s important to use the GetValueOnGameThread() method when accessing its value to ensure thread safety.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Performance/EnginePerformanceTargets.cpp:34

Scope: file

Source code excerpt:

// Minimum time passed before we'll record a new hitch
TAutoConsoleVariable<float> GHitchDeadTimeWindowCVar(
	TEXT("t.HitchDeadTimeWindow"),
	200.0f,
	TEXT("Minimum time passed before we'll record a new hitch (in ms)\n")
	TEXT(" default: 200.0 ms"),
	ECVF_Scalability);

// For the current frame to be considered a hitch, it must have run at least this many times slower than the previous frame

#Associated Variable and Callsites

This variable is associated with another variable named GHitchDeadTimeWindowCVar. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Performance/EnginePerformanceTargets.cpp:33

Scope: file

Source code excerpt:


// Minimum time passed before we'll record a new hitch
TAutoConsoleVariable<float> GHitchDeadTimeWindowCVar(
	TEXT("t.HitchDeadTimeWindow"),
	200.0f,
	TEXT("Minimum time passed before we'll record a new hitch (in ms)\n")
	TEXT(" default: 200.0 ms"),
	ECVF_Scalability);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Performance/EnginePerformanceTargets.cpp:68

Scope (from outer to inner):

file
function     float FEnginePerformanceTargets::GetMinTimeBetweenHitchesMS

Source code excerpt:

float FEnginePerformanceTargets::GetMinTimeBetweenHitchesMS()
{
	return GHitchDeadTimeWindowCVar.GetValueOnGameThread();
}

float FEnginePerformanceTargets::GetHitchToNonHitchRatio()
{
	const float MinimumRatio = 1.0f;
	const float MaximumRatio = GetHitchFrameTimeThresholdMS() / GetTargetFrameTimeThresholdMS();