Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

fps display takes a very long time to stabilize

Open illwieckz opened this issue 11 months ago • 2 comments

On my end the displayed fps value is adding up until it reaches its real value, and this takes a long time (around 10s on my end to reach 600fps).

This may be an unwanted side effect of:

  • https://github.com/Unvanquished/Unvanquished/pull/2925

Smoothing the fps value to make it more readable is good but having to wait 10s to know the framerate is a bit too much.

illwieckz avatar Mar 08 '24 13:03 illwieckz

The algorithm pretends the FPS has been 0 for an infinite amount of time in the past. So if you run at 600 FPS for 5 seconds then you get 600 * (1 - 2^-5) = 581 and after 10 seconds, 600 * (1 - 2^-10) = 599.4.

The easiest thing to try is decreasing the half-life (first parameter of UpdateFPSCounter). If we change it to 0.5 second instead of 1 second then it would take 5s to stabilize rather than 10.

We could try incorporating a 2nd number into the FPS tracking state to keep track of how long the process has been running, avoiding the period of assumed 0 FPS. Although if it turns out that the first measured frame includes some loading tasks this might not solve your issue.

slipher avatar Mar 10 '24 08:03 slipher

If the first frame turns out to be equally fast, we could use an easy hack of assuming the speed was the same as during the first frame since forever.

slipher avatar Mar 10 '24 08:03 slipher