Skip to content

cpu_frame_ms

killown edited this page Mar 16, 2026 · 1 revision

Metric: cpu frame ms (Command Prep Time)


Executive Summary

cpu frame ms measures the time the CPU spends preparing a single frame before handing it off to the GPU. This includes processing input, running the simulation logic (moving the cubes), and recording the draw commands.

  • Lower is better: Gives the GPU more time to work.
  • The Bottle-neck: If this number is higher than your ideal ms, your GPU is sitting idle waiting for instructions.

Why this number matters

This metric identifies exactly where a performance problem lives. It separates the "Brain" (CPU) from the "Brawn" (GPU).

  1. The Lead Time: The CPU must finish its work fast enough to leave "room" for the GPU to execute.
  2. Logic Overhead: If you add 1,000 more cubes and this number jumps up, your simulation logic is too heavy. If it stays the same but the FPS drops, your GPU is the part that is struggling.

Understanding the Split

To get a perfect sync score, the sum of your parts must fit inside the ideal ms:

CPU Prep + GPU Execution + Slack = Ideal Refresh Interval

  • If cpu frame ms is high: You are "CPU Bound." No amount of upgrading your graphics card will make the app faster.
  • If cpu frame ms is low: You are "GPU Bound" or "VSync Limited." Your CPU is efficient and ready for more complex logic.

Troubleshooting

If cpu frame ms is... It means... The Fix
Spiking A background process or heavy logic task. Check for complex loops in your code or background OS activity.
Consistent but high Your simulation is too complex for the CPU. Optimize your math, use instanced rendering, or reduce object counts.
Near Zero Your CPU is waiting on the GPU. You have a "GPU Bottleneck." You can add more CPU-heavy logic for free.

The Goal

A "Guru" level implementation keeps cpu frame ms under 2ms. This ensures that the GPU gets the "Go" signal as early as possible in the refresh cycle, maximizing the available slack ms and protecting you against stutters.

Clone this wiki locally