Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Never sleep with common.framerate.max -2

Open illwieckz opened this issue 1 year ago • 14 comments

Never sleep with common.framerate.max -2.

This is useful when benchmarking for performance, to avoid benchmarking the sleep function.

unvanquished_2024-04-22_034803_000

illwieckz avatar Apr 26 '24 02:04 illwieckz

How can a busy loop where you just poll for events a million times per second possibly be better than sleeping?

slipher avatar Apr 26 '24 02:04 slipher

How can a busy loop where you just poll for events a million times per second possibly be better than sleeping?

Hmm… right I should better skip the loop entirely. 🤣️

Now done.

illwieckz avatar Apr 26 '24 02:04 illwieckz

How is the new version supposed to be different than putting minMsec = 0?

slipher avatar Apr 26 '24 03:04 slipher

I was just going to say the same. 🤣️

I wrote that yesterday late in the night, it looks like my brain wasn't fully functionnal. 🤡️

illwieckz avatar Apr 26 '24 03:04 illwieckz

I don't like how there is only 1 value that enables the reasonable version of unlocked FPS and 2147483647 values that enable the version that clearly violates the system's design assumptions. It should be harder to do it by accident.

BTW I'd be skeptical of any "performance measurements" made with 0 ms frame lengths. Some code could be skipped if it assumes something is already up to date since the time hasn't changed...

slipher avatar Apr 28 '24 01:04 slipher

It should be harder to do it by accident.

Why not make sure this one never does anything unless cheat is enabled?

illwieckz avatar Apr 28 '24 02:04 illwieckz

BTW I'd be skeptical of any "performance measurements" made with 0 ms frame lengths.

Well… we may benchmark the performance of the game, or the performance of the environment.

This also helps me notice how hardware pieces, hardware performance profiles, or drivers, or compiler level of optimizations, etc. have impact on how fast the computer go to compute the game (even if doing some part uselessy and redundantly). When reaching some level of fastness of the hardware and software environment, once I reach the 1000fps cap I can't know if this or that option makes the engine run faster.

I started thinking seriously about implementing this option in our code and just not rely on throwaway patches (like I did for years) when I delivered a computer some weeks ago and out of curiosity I ran the game, set -1 to common.framerate.max and with default configuration (so medium profile) I reached the 1000fps cap on 4K… I was like : « It looks like I will not be able to compare with newer hardware anymore »…

illwieckz avatar Apr 28 '24 02:04 illwieckz

It should be harder to do it by accident.

Why not make sure this one never does anything unless cheat is enabled?

How do you mean? Max FPS can't be a cheat cvar.

slipher avatar Apr 29 '24 00:04 slipher

I guess having another CHEAT cvar to disable all FPS limitations would work.

slipher avatar Apr 29 '24 00:04 slipher

I added a commit that implements my idea of a cheat value.

illwieckz avatar May 01 '24 11:05 illwieckz