Game Performance Optimization
Game performance optimization is the practice of making a game run at a steady frame rate on its target hardware, whether that is a phone, a console, or a PC. Developers use profiling tools to measure where each frame spends time on the processor and the graphics chip, then apply techniques such as reducing draw calls, managing memory allocation, and cutting visual detail to fit the time budget.
itSoftware engineering | OpenSkills.info
Recommended first:gameplay-programming
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: Game Performance Optimization
A game keeps making appointments with the display, which is a surprisingly unforgiving diary. Frame budget means the time allowed for one image: about 16.7 milliseconds at 60 frames per second, or 33.3 at 30. The game must simulate input, physics, animation, and gameplay, turn that result into graphics commands, then let the GPU draw the image. When the appointment slips, the player gets a late frame, better known as a hitch.
The first useful question is not how can it be faster, but which worker missed the appointment. The game and render threads use the CPU. The GPU executes the submitted graphics work. A CPU-bound build is waiting for the CPU to feed the GPU; a GPU-bound build has a GPU still working when the next frame wants to start. Lower the render resolution. If frame time barely moves, the CPU is probably still holding the clipboard.
The graphics side has its own bureaucratic disaster: a draw call costs CPU work to prepare and submit even when it draws hardly any pixels. Culling avoids submitting objects the camera cannot see. Batching and instancing reduce the number of calls that remain. Level of detail swaps a distant object for a less detailed version. None of these is a magic spell. They matter only when the measurement says that part of the frame is consuming the budget.
Memory gets a separate ledger. Unity's garbage collection can spread collection across frames, which turns one larger pause into smaller ones but does not make the work disappear. Streaming, runtime shader compilation, and thermal throttling can also make a game look healthy right until a particular moment, device temperature, or level transition objects. Average frame rate has an excellent publicist. A trace has receipts.
Start with the Introduction for the frame pipeline and vocabulary. Use the Slides when you need the CPU or GPU decision path in compact form. Keep the Cheatsheet close during a profiling session, then use the Practice Reference for the engine commands, capture tools, and recapture loop. Each has one job, which is more than can be said for a frame asked to render a forest, three explosions, and a reflective puddle before breakfast.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://dev.epicgames.com/documentation/en-us/unreal-engine/introduction-to-performance-profiling-and-configuration-in-unreal-engine
Supports
- Definition of performance as frame time against a target frame rate (FPS)
- CPU-bound, GPU-bound, memory, and network as the four bottleneck categories
- Unreal Insights, stat commands, and RenderDoc as available profiling tools
- CVars and config files as performance configuration mechanisms
- https://dev.epicgames.com/documentation/en-us/unreal-engine/stat-commands-in-unreal-engine
Supports
- stat unit reporting Frame, Game, Draw, and GPU timings for major engine threads
- stat fps, stat game, stat gpu, stat scenerendering, stat memory as available commands
- stat startfile / stat stopfile recording a trace file for Unreal Insights
- https://dev.epicgames.com/documentation/unreal-engine/unreal-insights-in-unreal-engine
Supports
- Unreal Insights as a stand-alone profiling system collecting, analyzing, and visualizing engine-emitted data across frames
- Coverage of threads, memory allocation (Memory Insights), and network traffic (Networking Insights) in one tool
- https://gpuopen.com/learn/unreal-engine-performance-guide/
Supports
- stat unit used to identify CPU vs GPU bottlenecks; scaling resolution to test whether the GPU is the constraint
- Visibility/frustum culling and the CPU cost of draw calls surviving culling
- Batching, auto-instancing, and Hierarchical LOD (HLOD) as draw-call reduction techniques
- Nanite Position Precision and Keep Triangle Percent controlling triangle density
- Radeon GPU Profiler case study illustrating wavefront occupancy and CPU submission overhead
- https://docs.unity3d.com/6000.4/Documentation/Manual/profiler-cpu-introduction.html
Supports
- Unity CPU Usage Profiler module Timeline, Hierarchy, Inverted Hierarchy, and Raw Hierarchy views
- Inspecting GC.Alloc call stacks without enabling Deep Profiling
- https://docs.unity3d.com/6000.4/Documentation/Manual/ProfilerGPU.html
Supports
- Unity GPU Usage Profiler module breakdown by Opaque, Transparent, Shadows/Depth, Deferred Geometry, Deferred Lighting, PostProcess categories
- Toolbar reporting the CPU/GPU time split for a captured frame
- GPU module working only in Play mode or builds, and requiring Graphics Jobs disabled
- https://docs.unity3d.com/6000.0/Documentation/Manual/frame-timing-manager.html
Supports
- FrameTimingManager capturing CPU and GPU frame timing data at runtime
- Four-frame delay for CPU results and three-frame delay for GPU results
- FrameTimingManager decreasing performance while recording, especially on OpenGL ES
- https://docs.unity3d.com/6000.1/Documentation/Manual/performance-incremental-garbage-collection.html
Supports
- Incremental garbage collection as Unity's default, splitting collector work across multiple frames
- Non-incremental (stop-the-world) collection stopping the main thread in one long interruption
- Incremental GC not reducing total collection work, only redistributing pause length
- Incremental GC unsupported on the Web platform
- https://docs.unity3d.com/Packages/[email protected]/manual/profilermarker-guide.html
Supports
- ProfilerMarker as a named profiler handle, more efficient than Profiler.BeginSample
- Profiler.BeginSample transferring a full string per call vs ProfilerMarker's integer identifier
- ProfilerMarker.Begin/End being thread-safe and usable in jobified code
- https://docs.unity3d.com/6000.1/Documentation/Manual/performance-track-garbage-collection.html
Supports
- Tracking GC allocated-in-frame statistics in the Memory Profiler module details pane
- https://docs.unity3d.com/6000.2/Documentation/Manual/performance-disabling-garbage-collection.html
Supports
- Use Incremental GC setting under Edit > Project Settings > Player > Other Settings > Configuration
- https://renderdoc.org/docs/how/how_capture_frame.html
Supports
- RenderDoc capture key (F12 default, Print Screen alternative) capturing the next frame after keypress
- Launch Application workflow and capture confirmation overlay
- https://renderdoc.org/renderdoc-history.html
Supports
- RenderDoc public release in February 2014 as a free, open-source graphics debugger
- https://renderdoc.org/
Supports
- RenderDoc as a stand-alone, free, open-source graphics debugging tool for Direct3D, Vulkan, and OpenGL
- https://learn.microsoft.com/en-us/windows/win32/direct3dtools/pix/articles/general/pix-overview
Supports
- PIX as a debugging and profiling tool for Direct3D 12 game developers
- GPU Captures and Timing Captures as PIX's two profiling approaches
- https://devblogs.microsoft.com/pix/
Supports
- PIX on Windows official site and download/documentation home
- https://developer.nvidia.com/nsight-graphics
Supports
- Nsight Graphics debugging, profiling, and frame export for Direct3D, Vulkan, OpenGL, OpenXR
- Graphics Capture, Frame Debugger, and GPU Trace Profiler activities
- https://developer.nvidia.com/nsight-systems
Supports
- Nsight Systems as a system-wide profiling tool for applications on NVIDIA platforms
- https://gpuopen.com/rgp/
Supports
- Radeon GPU Profiler analyzing graphics application performance on AMD GPUs
- https://www.intel.com/content/www/us/en/developer/tools/graphics-performance-analyzers/overview.html
Supports
- Intel Graphics Performance Analyzers as an analysis/optimization suite for Direct3D, Vulkan, and OpenGL games
- https://developer.android.com/agi
Supports
- Android GPU Inspector profiling OpenGL ES and Vulkan games
- System-wide tracing (GPU, CPU, memory, battery) and per-frame GPU capture
- Support for Qualcomm Adreno, Arm Mali, and Imagination PowerVR GPUs
- https://developer.apple.com/metal/tools/
Supports
- Xcode Metal System Trace providing a combined CPU/GPU/memory timeline for Metal apps
- Metal Debugger and System Trace as Xcode/Instruments performance tools
- https://developer.apple.com/documentation/metal/using_metal_system_trace_in_instruments_to_profile_your_app?preferredLanguage=occ
Supports
- Metal System Trace visualizing parallel CPU/GPU work and memory usage in a Metal app
- https://github.com/wolfpld/tracy
Supports
- Tracy as a real-time, nanosecond-resolution hybrid frame and sampling profiler
- CPU (C, C++, Lua, Python, Fortran) and GPU (OpenGL, Vulkan, D3D11/12, Metal, OpenCL, CUDA, WebGPU) profiling coverage
- Free, open-source distribution
- https://superluminal.eu/
Supports
- Superluminal as a CPU profiler for C/C++ and Rust on Windows, Xbox One, and PlayStation 4
- https://github.com/stevinz/awesome-game-engine-dev
Supports
- Discovery of Nsight, PIX, RenderDoc, and Tracy Profiler as curated debugging/profiling tools
- Nsight described as debugging, profiling, and exporting frames for Direct3D, Vulkan, OpenGL, OpenXR
- PIX described as debugging and profiling for game developers using Direct3D 12
- RenderDoc described as a stand-alone graphics debugging tool
- Tracy Profiler described as a frame profiler
- https://www.nvidia.com/en-us/geforce/technologies/dlss/
Supports
- DLSS as a suite of AI neural rendering technologies that boost FPS and improve image quality
- Tensor Core acceleration underlying DLSS reconstruction
- https://www.nvidia.com/en-us/geforce/news/battlefield-v-metro-exodus-ray-tracing-dlss/
Supports
- DLSS shipping in Battlefield V and Metro Exodus in February 2019, among its first supported games
- DLSS providing a reported performance boost with ray tracing enabled
- https://www.amd.com/en/products/graphics/technologies/fidelityfx-super-resolution.html
Supports
- FidelityFX Super Resolution as an open, vendor-agnostic spatial/temporal upscaling technology
- https://ir.amd.com/news-events/press-releases/detail/1011/with-amd-fidelityfx-super-resolution-amd-brings-high-quality-high-resolution-experiences-to-gamers-worldwide
Supports
- AMD FidelityFX Super Resolution general availability announced June 22, 2021
- Seven initial launch titles supporting FSR at release
- https://www.intel.com/content/www/us/en/developer/topic-technology/gamedev/xess.html
Supports
- Intel XeSS as an AI-enhanced upscaling technology accelerated on Intel Arc GPUs with a fallback path on other hardware
- https://unity.com/features/profiling
Supports
- Unity Profiler connecting to devices on a network or attached to a computer to test performance on the intended release platform
- https://www.design-reuse.com/news/11759/ibm-power-chip-microsoft-xbox-360-launch.html
Supports
- IBM's October 25, 2005 announcement of the custom triple-core PowerPC-based Xbox 360 processor
- Three cores, two threads per core, clock speed greater than 3 GHz, 165 million transistors, 90nm SOI fabrication
- https://sonyinteractive.com/en/press-releases/2005/ibm-sony-sony-computer-entertainment-inc-and-toshiba-disclose-key-details-of-the-cell-chip/
Supports
- IBM, Sony, and Toshiba disclosing additional technical details of the Cell Broadband Engine in 2005
- Cell's heterogeneous design combining a general-purpose core with multiple specialized SIMD processing elements
- https://sonyinteractive.com/en/press-releases/2006/playstation3-launcheson-november-17-2006-in-north-america/
Supports
- PlayStation 3 launching in North America on November 17, 2006, powered by the Cell processor
- https://www.khronos.org/news/press/khronos-releases-vulkan-1-0-specification
Supports
- Khronos Group releasing the Vulkan 1.0 specification on February 16, 2016
- Vulkan drivers and SDKs released the same day by Khronos member companies
- https://devblogs.microsoft.com/directx/windows-10-and-directx-12-released/
Supports
- DirectX 12 shipping commercially with Windows 10 in July 2015
- DirectX 12's low-overhead, explicit-submission model as a departure from the DirectX 11 driver-managed model
- https://www.unrealengine.com/en-US/blog/a-first-look-at-unreal-engine-5
Supports
- Epic Games' official reveal of Unreal Engine 5 on May 13, 2020, via the "Lumen in the Land of Nanite" demo
- Nanite virtualized micropolygon geometry and Lumen dynamic global illumination as the two headline systems introduced
- https://discussions.unity.com/t/unity-released-ecs-1-0-production-ready-finally/901873
Supports
- Unity announcing Entities (ECS) 1.0 as production-ready for Unity 2022.2+ on December 2, 2022
- https://docs.unity3d.com/Packages/[email protected]/manual/index.html
Supports
- Entities package overview describing Unity's data-oriented ECS implementation
- https://www.riotgames.com/en/news/down-rabbit-hole-performance-monitoring
Supports
- Riot's live-player frame-time monitoring across patches, regions, and player hardware
- Average frame time masking poor performance in demanding team fights
- https://developer.nvidia.com/blog/limiting-cpu-threads-for-better-game-performance/
Supports
- Some CPU-bound games improving when worker thread counts are reduced below CPU core count
- Cache, lock, scheduling, and power-management contention as reasons higher thread counts can hurt performance
- https://developer.nvidia.com/blog/?p=67605
Supports
- DX12 background driver optimization changing GPU timings without an application-side change
- Pausing game time, holding the camera fixed, and waiting for background optimization before measuring
- https://developer.nvidia.com/blog/best-practices-gpu-performance-events/
Supports
- A top-level Frame event, stable event names, and limited marker verbosity for useful GPU traces
- Avoiding API-primitive markers in favor of workload-level instrumentation
- https://developer.nvidia.com/blog/?p=16824
Supports
- Nsight Systems locating stutter frames and exposing the responsible CPU thread and API calls
- A Wolfenstein: Youngblood ray-tracing pipeline creation call measured at 30.8 milliseconds in a stutter frame
