| |||
| Home > The Optimization Process > General optimization advice > Use frame time instead of FPS for measurements | |||
Frames per second is a simple and basic measurement of performance, but frame time is a better measure of optimization effectiveness.
The reason frame time is a better measurement is that frame time is a linear measure whereas frames per second is non-linear. Linear measurements also make calculations easier.
Figure 3.2 shows frames per second plotted against frame time. This graph illustrates the non-linear nature of FPS measurements.
If you know the individual time changes corresponding to different optimizations, you can add the times together to get the total improvement.
If you are using FPS as a measurement, you cannot add them together because their non-linear nature. Any attempt to add them gives an incorrect total.
Table 3.1 shows a series of comparisons between different FPS measurements A and B.
The FPS changes by a different amount for every measurement, but the frame time changes by the same amount every time. For example, going from 100 FPS to 200 FPS involves a difference of 100 FPS or 5ms. However going from 20 FPS to 22.2 FPS is a difference of 2.2 FPS but this is also 5ms. The linear nature of frame time is easier to work with when you are measuring the impact of optimizations.
Table 3.1. Difference between frames per second and frame time
| Frame time A | FPS A | Frame time B | FPS A | FPS difference | Frame time difference |
|---|---|---|---|---|---|
| 70ms | 14.3 | 65ms | 15.4 | 1.1 | 5ms |
| 60ms | 16.7 | 55ms | 18.2 | 1.5 | 5ms |
| 50ms | 20 | 45ms | 22.2 | 2.2 | 5ms |
| 40ms | 25 | 35ms | 28.6 | 3.6 | 5ms |
| 30ms | 33.3 | 25ms | 40 | 6.7 | 5ms |
| 25ms | 40 | 20ms | 50 | 10 | 5ms |
| 20ms | 50 | 15ms | 66.6 | 16.6 | 5ms |
| 15ms | 66.6 | 10ms | 100 | 33.4 | 5ms |
| 10ms | 100 | 5ms | 200 | 100 | 5ms |