Performance: find the cause of a delay
Where to begin when a game stalls: frames, CPU, loading, threads and measurable results.
Describe the problem first
Record the target device, resolution, graphics settings, build and repeatable action, such as turning the camera in a plaza containing 200 characters. An empty-level measurement does not explain a stall in that scene. Separate sustained low FPS, occasional long frames and loading waits: they have different causes.
| Target | Budget per frame |
|---|---|
| 30 FPS | about 33.33 ms |
| 60 FPS | about 16.67 ms |
| 120 FPS | about 8.33 ms |
The budget is 1000 / FPS, not guaranteed time for every script. CPU, GPU, synchronization and presentation may overlap. Adding every measurement from different threads does not produce frame duration.
Choose the next step
| Observation | Action |
|---|---|
| Low FPS or occasional stalls | Capture frame intervals, p95 and maximum in the same scenario |
| Suspected gameplay code | Measure a specific section and check CPU and C# profiling limits |
| Expensive independent computation | Move only data into a background job, applying results on the main thread |
| A growing queue or object count | Add a custom monitor |
| Entity access error from a worker | Separate ownership using the thread-safety rules |
Lowering resolution without changing the scene helps investigate rendering cost. Improvement after disabling one gameplay system helps locate CPU work. These are diagnostic experiments, not proof from a single changed parameter: retain measurements and repeat.
Acceptance criterion
A change is useful when the required scenario meets its budget on the target device, occasional stalls are acceptable, game behavior is preserved, and memory/loading remain within their limits. State the conditions and compare several matching runs. “Faster on my computer” without a scenario and measurements is not an acceptance criterion.
These examples check statistics and job lifetime on the installed Windows 1.0.0 build. They do not establish your game's FPS, a benefit from multithreading or other-platform performance.