Use frame time not frame rate when working on performance
Hi, I've heard you were working on an interactive graphical application, and that you're doing your best to give it a smooth frame rate.
Here is a piece of advice about measurements. Try to ignore changes in frame rate when measuring and tracking the performance of a component within the complete system. Remember instead your frame time budget (e.g. 16ms for a 60hz target) and track the time your component takes within that budget.
You should see why when looking at the relationship between your efforts and the measurements.
Since frame rates are inversely proportional to frame times, for the same optimization (a delta in time: Δt), you will observe different frame rate deltas when you start from different frame times. (e.g. in different testing conditions or if the system changes)
Δt=ms Max(time)=msThis comes directly from the definition: ratehz = 1/times. Since it is non-linear, rates in hz for various subcomponents cannot be added to one another. Frame times however can be added and be used to predict the performance of the resulting system.
To deliver a smooth experience, what matters is whether your complete system will consistently meet its per-frame budget, such as 16ms for a 60hz target.
That budget is best monitored with deltas in time, as for given workloads the deltas can be added to predict the overall performance of the system.
Some examples
For the same gain in frame time budget of 1ms:
If the system was spending 15ms of rendering time per frame, an improvement of 1ms would increase the frame rate by about 5 frames or 7%.
If however that system was spending about 6ms in total the same optimization effort would come out as an improvement of 34 frames or 20%.
Thanks
Thanks to Gregor Klinke for reviewing a draft of this text.
Glossary
- Frame: a coherent drawing (or render) on the screen representing an instant in an animation or simulation
- Frame rate: Frame Per Second, FPS.
- Frame time: Time Per Frame, TPF
Similar arguments or examples
- http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0555c/BEIGDEGC.html
- https://www.mvps.org/directx/articles/fps_versus_frame_time.htm
- http://renderingpipeline.com/2013/02/fps-vs-msecframe/
- https://docs.unrealengine.com/latest/INT/Engine/Performance/CPU/index.html profilers screenshot in ms not hz
- http://jcgt.org/published/0001/01/03/ in terms of energy