Performance¶
17 tools for frame rate, frame timing and memory, Unreal Insights traces and timing regions, and runtime virtual textures.
Back to the index.
add_trace_bookmark¶
Additive
Emit a TRACE_BOOKMARK into the active .utrace at the current frame. The bookmark channel must be enabled in the trace (default start_trace channels include it). The text is dynamic via printf-style formatting, but the Format token itself is a TEXT() literal as required by the macro's static_assert.
| Parameter | Type | Required | Description |
|---|---|---|---|
text |
string | yes | The bookmark text. Becomes the bookmark label in UnrealInsights. |
Returns: { bookmarked: bool, text: string, frame: int, note: string }
assign_runtime_virtual_texture_to_landscape¶
Destructive
Add a URuntimeVirtualTexture to the landscape's RuntimeVirtualTextures array (slot-index based) AND propagate it to every ALandscapeStreamingProxy of that landscape, because in World Partition the proxies are the actors that render. Every proxy is re-read after the write; applied and the envelope success are DERIVED from that re-read (proxies_with_rvt == proxies_total), never asserted.
| Parameter | Type | Required | Description |
|---|---|---|---|
landscape_name_or_label |
string | yes | Actor label/name of the target ALandscape |
rvt_asset_path |
string | yes | /Game path to the RVT asset |
slot_index |
integer | no | 0-based index into LandscapeProxy::RuntimeVirtualTextures (default 0) |
propagate_to_proxies |
boolean | no | Optional bool, default TRUE. Opt-out that writes the landscape actor alone. NOTE: with it false the proxies stay empty and nothing writes to the RVT cache, so applied will still report false (plus a warning) unless the proxies already carried the RVT -- the opt-out exists to reproduce that write, not to bless its result. |
Returns: { applied, slot_index, rvt_asset_path, landscape, landscape_has_rvt, propagate_to_proxies, proxies_total, proxies_updated, proxies_with_rvt, proxies_missing: [string], proxies_missing_truncated: bool, proxy_enumeration, warning?, requested: {...} }
create_runtime_virtual_texture¶
Additive
Create a URuntimeVirtualTexture asset at directory_path/asset_name with the given material type, tile count and tile size (both exponents, clamped silently), and save it; the save result is not checked. Returns asset_path, tile_count, tile_size and size in texels. Then use create_runtime_virtual_texture_volume and assign_runtime_virtual_texture_to_landscape.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_name |
string | yes | Name of the new RVT asset (e.g. "RVT_Landscape"), without a folder. |
directory_path |
string | no | Content folder as a long package path (e.g. "/Game/VirtualTextures"), not a relative one (default /Game). |
material_type |
string | no | One of "BaseColor_Normal_Specular", "BaseColor_Normal_Roughness" or "WorldHeight", case-insensitive (default "BaseColor_Normal_Specular"); any other value, BaseColor_YCoCg included, is refused. |
tile_count |
integer | no | Exponent of the size in tiles: 2^n tiles, clamped to 0..12 (default 8 = 256 tiles); a texel value such as 256 is clamped to 12. |
tile_size |
integer | no | Exponent of the tile size: 2^(n+6) texels, clamped to 0..4 (default 2 = 256 texels). |
continuous_update |
boolean | no | When true, already mapped pages are re-rendered round-robin (bContinuousUpdate); default false. |
Returns: { asset_path, material_type, tile_count, tile_size, size }
create_runtime_virtual_texture_volume¶
Additive Idempotent
Spawn an ARuntimeVirtualTextureVolume (the RVT producer that registers the runtime virtual texture into the scene and defines its world-space region) bound to an RVT asset. Without a volume, assign_runtime_virtual_texture_to_landscape only wires the landscape as a writer -- nothing produces the RVT. Optionally fits the volume bounds to an actor (usually the landscape) in the same call. Headless-safe: spawns with a null VirtualTexture (no render-state) then binds a valid RVT. Idempotent: returns the existing volume if one already targets this RVT.
| Parameter | Type | Required | Description |
|---|---|---|---|
rvt_asset_path |
string | yes | Required. /Game path to the URuntimeVirtualTexture asset (create_runtime_virtual_texture). |
bounds_align_actor |
string | no | Optional. Name/label of an actor (usually the ALandscape) to fit the volume bounds to; runs the engine "Set Bounds" after binding. |
volume_name |
string | no | Optional. Actor label for the spawned volume. |
location |
array | no | Optional [x,y,z] spawn location (default [0,0,0]; overridden by the bounds-align when bounds_align_actor is given). |
Returns: { volume_name, rvt_asset_path, bounds_aligned, bounds_align_actor?, already_existed }
end_timing_region¶
Destructive
Close an open named region and return its duration in ms. Removes the region from the active set; subsequent end_timing_region with the same name returns an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Region identifier. Must match an open region. |
Returns: { ended: bool, name: string, duration_ms: float, duration_s: float }
get_fps_info¶
Read-only
Read a one-call frame-rate snapshot of the editor without changing anything: current_fps from the editor world's last tick (0 while paused or before the first tick, and the editor world even while PIE runs), target_fps (the engine max-FPS cap, or 60 when uncapped) and their difference, the engine-wide rolling averages GAverageFPS and GAverageMS, frame pacing (r.VSync, smoothing, max and min FPS), the r.ScreenPercentage in use, the live UObject count, process physical memory in bytes and MB, and the world's name and net mode. Use it for a quick is-it-fast-enough check; for per-thread times and a CPU/GPU bottleneck verdict use get_frame_timing, for a memory breakdown (scene, GPU, system) get_memory_usage, for quality presets get_scalability_levels, and for a profile over time start_trace. The values are instantaneous: an unfocused editor is throttled, so call it twice and compare. Errors only when there is no editor world.
No parameters.
Returns: { current_fps: float, target_fps: float, fps_variance: float, average_fps: float (GAverageFPS), average_ms: float (GAverageMS), engine_version: string, is_editor: bool, is_dedicated_server: bool, performance_settings: {vsync_enabled (r.VSync), smooth_frame_rate, max_fps (0 = uncapped), min_fps (lower bound of frame-rate smoothing; 0 without it)}, screen_percentage: float (r.ScreenPercentage within the scalability range), object_count: int, memory: { used_physical_bytes, peak_used_physical_bytes, available_physical_bytes, total_physical_bytes, used_physical_mb, peak_used_physical_mb, available_physical_mb }, world_name: string, net_mode: string }
get_frame_timing¶
Read-only
Read the current frame's Game/Render/GPU/RHI thread times plus a CPU-vs-GPU bottleneck verdict with an actionable hint.
No parameters.
Returns: { frame_ms: float, game_thread_ms: float, render_thread_ms: float, rhi_thread_ms: float, game_thread_wait_ms: float, render_thread_wait_ms: float, gpu_ms: float, cpu_busy_ms: float, verdict: "GPU-bound"|"CPU-bound (game thread)"|"CPU-bound (render thread)"|"VSync/present bound"|"balanced"|"no-data", hint: string, null_rhi: bool, note: string } -- cpu_busy_ms is game + render + rhi; null_rhi is true with -nullrhi or in a commandlet, where the timings read 0 (verdict "no-data" when they all do) and note warns of it; otherwise note is empty.
get_memory_usage¶
Read-only
Read a snapshot of memory use for the whole editor process without changing anything, in four blocks: process_memory (used, peak, available and total physical, used and peak virtual, in whole MB), scene_memory (a walk of every actor of the editor world, not a PIE world: actors, components, and on StaticMeshActors only the meshes, distinct materials and the distinct textures those materials use, plus every UTexture2D resident in memory process-wide), gpu_memory (dedicated, shared and total video memory, present only when the RHI reports them, and streaming and non-streaming texture memory) and system_info (platform, CPU brand, cores, threads). Use it to see where memory goes overall; for one asset's own size use get_asset_memory_usage, for byte-precise process memory next to the frame rate get_fps_info. The scene walk visits every actor, so it costs more on big levels. Errors only when there is no editor world.
No parameters.
Returns: { process_memory: {used_physical_memory_mb, peak_used_physical_memory_mb, available_physical_memory_mb, total_physical_memory_mb, used_virtual_memory_mb, peak_used_virtual_memory_mb}, scene_memory: {actor_count, component_count, static_mesh_count, material_count (distinct), material_slot_count, texture_count (distinct textures the scene's materials use), resident_texture_count (every UTexture2D in memory)}, gpu_memory: {gpu_memory_available, gpu_memory_status, rhi_name, dedicated_video_memory_mb?, shared_system_memory_mb?, total_graphics_memory_mb?, streaming_texture_memory_mb, non_streaming_texture_memory_mb}, system_info: {platform, cpu_brand, cpu_cores, cpu_threads} }
get_runtime_virtual_texture_info¶
Read-only
Read a URuntimeVirtualTexture asset without changing it: material_type (full enum name, e.g. "ERuntimeVirtualTextureMaterialType::WorldHeight"), tile_count in tiles, tile_size and size in texels (not the exponents create_runtime_virtual_texture takes), and continuous_update.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Object or package path of the RVT asset (e.g. "/Game/VirtualTextures/RVT_Landscape"). |
Returns: { asset_path, material_type, tile_count, tile_size, size, continuous_update }
get_trace_status¶
Read-only
Reports whether Unreal Insights tracing is available in this build, whether a trace is recording right now, and to which file or server. Read-only and instant: it starts and stops nothing. Call it before start_trace to see whether a trace is already running (for example one started with -trace on the command line, which start_trace would not replace), or after stop_trace to confirm the recording ended. list_traces lists the recorded .utrace files on disk, and list_timing_regions the open timers of start_timing_region, which are not traces.
No parameters.
Returns: { system_status: "not_available"|"available"|"tracing_to_file"|"tracing_to_server"|"tracing_to_secure_network"|"tracing_to_custom_relay"|"unknown", compile_time_enabled: bool, connected: bool, destination: string, elapsed_s: float } -- compile_time_enabled is false only when system_status is not_available (tracing compiled out, as in Shipping); destination is empty and elapsed_s 0 when not connected, and elapsed_s is also 0 for a trace start_trace did not start.
list_timing_regions¶
Read-only
Read-side of start_timing_region: the named timing regions still OPEN in this bridge instance, each with how long it has been running. Use it to spot a region you forgot to close, or to read an elapsed time without ending the region. Entries disappear when end_timing_region closes them, one name at a time; the state is per bridge instance and does not survive a restart.
No parameters.
Returns: { total, regions:[{ name, started_at_s, elapsed_s }] }
list_traces¶
Read-only
Enumerate .utrace files in <ProjectDir>/Saved/Profiling/, returning their path, size and modification time, sorted by name and paged with offset/limit.
| Parameter | Type | Required | Description |
|---|---|---|---|
offset |
integer | no | Index of the first entry returned, counted from 0 (default 0). Read the next page at the reply's next_offset. |
limit |
integer | no | Most entries returned per call, 1..1000 (default 100). |
Returns: { directory: string, count: int (entries in this page), traces: [{ path, name, size_bytes, modified_iso }], total: int, offset: int, limit: int, returned: int, truncated: bool, next_offset: int|null } -- directory is the resolved profiling folder; only its own files are listed, not subfolders.
set_runtime_virtual_texture_volume_bounds¶
Destructive Idempotent
Fit an existing ARuntimeVirtualTextureVolume's bounds to an actor -- the engine "Set Bounds" button (RuntimeVirtualTexture::SetBounds). Sets the volume's BoundsAlignActor and recomputes its transform to cover that actor (a landscape uses its complete bounds) plus any primitives writing to the volume's RVT. The volume must already have its RVT bound (create_runtime_virtual_texture_volume). Optional landscape texel-snap + bounds expansion.
| Parameter | Type | Required | Description |
|---|---|---|---|
volume_name |
string | yes | Required. Actor name/label of the ARuntimeVirtualTextureVolume. |
bounds_align_actor |
string | yes | Required. Name/label of the actor (usually the ALandscape) to fit the bounds to. |
snap_to_landscape |
boolean | no | Optional bool. Snap virtual-texture texels to landscape vertices (only meaningful when the align actor is a landscape). |
expand_bounds |
number | no | Optional float >= 0. Amount to expand the computed bounds. |
Returns: { volume_name, bounds_align_actor, snap_to_landscape, expand_bounds, applied }
start_timing_region¶
Additive Idempotent
Starts a named wall-clock timer in this editor session, to measure how long a stretch of work (several tool calls, a PIE run) takes; end_timing_region with the same name stops it and returns the elapsed time in ms. It needs no Insights trace and writes nothing to a trace or to disk: the start time is kept in memory only and is lost when the editor restarts. Idempotent: a name that is already open keeps its original start time and returns already_started true with started false. list_timing_regions shows the open timers; for engine-level profiling use start_trace with add_trace_bookmark instead.
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Required timer name, any non-empty string (e.g. "import_pass"); pass the same name to end_timing_region (names match case-insensitively). |
Returns: { started: bool, already_started: bool, name: string, started_at_s: float, note?: string } -- started_at_s is the editor's platform clock in seconds; note only when the region was already open
start_trace¶
Additive Idempotent
Starts recording an Unreal Insights trace of this editor process to a new .utrace file, for profiling CPU, GPU and frame timing with the chosen channels. Idempotent: while any trace is active, including one started with -trace on the command line, it starts nothing and returns already_tracing true with the current destination; call stop_trace first for a new recording. The engine will not write over an existing file: an output_path that already exists makes the call fail with nothing started. Only the trace file is written; assets and levels are untouched. Flow: start_trace, reproduce the problem, mark moments with add_trace_bookmark, stop_trace to flush, list_traces to find the file; get_trace_status tells whether a trace is running. Of the marking tools only add_trace_bookmark writes into the trace: start_timing_region timers are kept in memory and never written to it. For a quick reading without a file use get_frame_timing or get_fps_info.
| Parameter | Type | Required | Description |
|---|---|---|---|
channels |
string | no | Comma-separated Insights channels to enable (default "cpu,frame,bookmark"; others: gpu, region, memtag, counters, log, screenshot), e.g. "cpu,gpu,frame,bookmark". |
output_path |
string | no | Path of the .utrace file to create, absolute (e.g. "D:/Traces/run1.utrace") or relative to <ProjectDir>/Saved/Profiling; another extension is changed to .utrace and the folder is created. Default <ProjectDir>/Saved/Profiling/MCP_<YYYYMMDD_HHMMSS>.utrace. |
Returns: { tracing: bool, already_tracing: bool, destination: string, channels?: string, started_at_s?: number, connection_type?: string, elapsed_s?: number, note: string } -- channels and started_at_s for a new trace; connection_type (file, server, custom_relay...) and elapsed_s when a trace was already active
stop_trace¶
Destructive Idempotent
Stop the active Unreal Insights trace and return its destination, duration and file size. Idempotent — calling stop_trace when no trace is active returns was_tracing:false with a note instead of failing.
No parameters.
Returns: { stopped: bool, was_tracing: bool, destination?: string, duration_s?: float, size_bytes?: int, note: string } -- with no trace running only stopped:false, was_tracing:false and note; when the engine's Stop() refuses because the trace is already stopping, stopped is false and size_bytes is absent; after a stop, note says to open the .utrace in Unreal Insights. duration_s is 0 for a trace start_trace did not start.
unassign_runtime_virtual_texture_from_landscape¶
Destructive
Inverse of assign_runtime_virtual_texture_to_landscape: clears ONE slot of a landscape's RuntimeVirtualTextures array, breaking the binding without leaving a dangling entry behind. It unbinds only -- the RVT asset itself survives (delete_asset with expected_class "RuntimeVirtualTexture" destroys that). Reports the asset path that was in the slot, so the operation is reversible.
| Parameter | Type | Required | Description |
|---|---|---|---|
landscape_name |
string | no | Actor name (or label) of the ALandscape actor (omit for first landscape in world) |
slot_index |
integer | no | 0-based index to clear (default 0) |
Returns: { cleared, slot_index, previous_rvt_asset_path?, landscape }