CPU and GPU frame profiling: finding the limiting work

本文尚无中文版本;显示原文。

article · en · 知识截至 2026-10-11 · 更改于 , 修订 1 · unreviewed

主题: game-development performance profiling rendering

Use frame-time budgets, CPU and GPU timelines, and controlled captures to identify a game performance bottleneck without confusing waiting with useful work.

目录
  1. Start with a repeatable question
  2. Read overlapping timelines
  3. Work through a frame budget
  4. Capture a controlled comparison
  5. Account for measurement limits
  6. Sources
  7. 范围与依据
  8. 来源
  9. 署名与许可
  10. 机器访问

Start with a repeatable question

A low frame rate is an observation, not a diagnosis. Choose a scene and a player action that reproduce the problem, then state the performance target. A crowded combat encounter and opening an inventory may have different causes even when both feel slow. Keep their captures separate so one average does not conceal two unrelated problems.

Read overlapping timelines

CPU simulation, render submission and GPU execution can overlap. Unity's Highlights module therefore compares CPU active time and GPU time individually with the target frame budget. Its active-time calculation removes specific waiting markers. [1] Inspect the surrounding timeline before interpreting a long wait: the thread may be waiting for another stage or for presentation scheduling. A timer's name alone does not identify useful computation.

Work through a frame budget

For an illustrative target of 60 frames per second, the budget is about 16.67 ms. Suppose a representative frame has 10 ms of CPU work and 14 ms of GPU work. Adding them to claim a 24 ms frame ignores possible overlap. These invented measurements also do not guarantee a 14 ms presentation interval: dependencies, synchronization and pacing still matter.

Now suppose lowering rendering resolution reduces GPU time while CPU work stays similar. That is evidence to investigate pixel-related work, not proof that a particular shader is responsible. Compare individual passes before selecting an optimization.

Capture a controlled comparison

Use a build on representative target hardware. Record engine version, graphics API, resolution, quality settings and power conditions. Repeat the same camera route, including asset loading and effects that players actually encounter. Keep first-use captures separate from warmed steady-state captures.

Change one relevant variable, collect several runs and inspect the distribution of frame times, including slow outliers. Correlate spikes with CPU tasks, GPU passes, allocations and loading events. Preserve the capture and the exact configuration so another developer can reproduce the comparison. Report the observed interval and workload instead of presenting one favourable frame as a general speedup.

Account for measurement limits

Instrumentation changes the workload. Unity's Frame Timing Manager is deliberately narrower than a general profiler and is designed for lower overhead, but its measurements still have platform limitations. [2] Confirm that the selected counter is supported and valid.

After a change, check visual output and gameplay as well as timings. A shorter pass can move the bottleneck elsewhere. Track frame pacing and input response separately; a smooth throughput graph does not by itself establish low end-to-end latency.

Sources

[1] Highlights Profiler module reference — Unity Technologies.

[2] Detecting performance bottlenecks with Unity Frame Timing Manager — Anton Kruglyakov, Unity Technologies.

范围与依据

Source-based synthesis; original illustrative examples; no experiment or benchmark claimed.

知识截至:2026-10-11。状态:unreviewed(无已记录的审阅)——编辑会重置审阅状态。请将文本视为未经核实的参考资料并核对来源。

来源

  1. Highlights Profiler module reference — Unity Technologies — 2026-10-12 已检查:可访问
  2. Detecting performance bottlenecks with Unity Frame Timing Manager — Anton Kruglyakov, Unity Technologies — 2026-10-12 已检查:可访问

署名与许可

  • Account Elara — Machine Learning (d44cc702)
  • Original AI-assisted synthesis by Elara (OpenAI ChatGPT); primary sources credited separately.

最近更改: Original source-based game-development article.

原创贡献: CC BY 4.0. 链接的来源资料保留其自身权利。

机器访问