ue-profiling-and-optimization

Profile and optimize Unreal Engine performance using Unreal Insights, stat commands, and C++ instrumentation.

55|5|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/kevinpbuckley/unreal-engine-skills --skill ue-profiling-and-optimization-kevinpbuckley
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ue-profiling-and-optimization
Source: https://github.com/kevinpbuckley/unreal-engine-skills/tree/main/skills/core/ue-profiling-and-optimization
Command: npx skills add https://github.com/kevinpbuckley/unreal-engine-skills --skill ue-profiling-and-optimization-kevinpbuckley

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Diagnosing frame-rate drops, hitches, CPU/GPU bottlenecks, and memory growth in Unreal Engine projects requires knowing which profiler to use, which stat commands to run, and how to instrument your own C++ code — this Skill provides that measurement-first workflow grounded in UE 5.8 source. ## Core Features & Use Cases - Unreal Insights & Trace: Capture .utrace sessions with cpu/gpu/memalloc/memtag channels, navigate Timing Insights and Memory Insights, and run leak-hunt queries. - Stat command triage: Read stat unit to identify whether the game thread, render thread, GPU, or RHI thread owns the frame budget, with a full command reference table. - C++ instrumentation: Add named timers with DECLARE_CYCLE_STAT, SCOPE_CYCLE_COUNTER, TRACE_CPUPROFILER_EVENT_SCOPE, and CSV_SCOPED_TIMING_STAT, including cross-file stat patterns and Shipping-build constraints. - Memory profiling: Use memreport, LLM tags, and Insights Memory Insights queries to attribute allocations and find leaks. - Use Case: Your game hitches during level transitions. Run stat unit to confirm the game thread is the bottleneck, capture an Insights trace with memalloc and memtag channels, then run a Memory Leaks query across the transition to find surviving allocations. ## Quick Start Use the ue-profiling-and-optimization skill to help me find why my Unreal Engine 5.8 game is hitching and add timing instrumentation to the suspected subsystem.

Frequently Asked Questions about ue-profiling-and-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find what is causing low FPS in Unreal Engine?

Run stat unit in the console first to see the Frame/Game/Draw/GPU/RHIT split. Whichever thread matches the frame time owns the bottleneck, then use stat game, stat gpu, or an Unreal Insights trace to drill into that thread.

How do I add custom timing scopes that appear in Unreal Insights?

Use TRACE_CPUPROFILER_EVENT_SCOPE from CpuProfilerTrace.h for low-overhead named scopes on the cpu channel, or DECLARE_CYCLE_STAT plus SCOPE_CYCLE_COUNTER from Stats.h when you also want a stat group HUD overlay.

What is the difference between SCOPE_CYCLE_COUNTER and TRACE_CPUPROFILER_EVENT_SCOPE?

SCOPE_CYCLE_COUNTER feeds the stats system and appears in stat group overlays and Insights, while TRACE_CPUPROFILER_EVENT_SCOPE writes directly to the Trace cpu channel with lower overhead. Prefer the trace macro for high-frequency code paths.

Why do my stat counters disappear in Shipping builds?

The STATS macro is 0 in Shipping builds, so all DECLARE_CYCLE_STAT and SCOPE_CYCLE_COUNTER code compiles to nothing. Use CSV_SCOPED_TIMING_STAT, which works in Test and Shipping, for production-visible metrics.

How do I find memory leaks in Unreal Engine with Unreal Insights?

Run a Development build with -trace=memalloc,memtag,callstack,module -llm, then open Memory Insights and run the Memory Leaks query with markers A, B, C around a level transition. Group results by callstack or LLM tag to find the allocation site.

Why does DECLARE_CYCLE_STAT in a header cause linker errors?

DECLARE_CYCLE_STAT emits a static DEFINE_STAT, so including the header in multiple translation units creates duplicate symbols. Use DECLARE_CYCLE_STAT_EXTERN in the header and DEFINE_STAT in exactly one .cpp file instead.